!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k="".trim,l={},m="1.11.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(l.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:k&&!k.call("\ufeff\xa0")?function(a){return null==a?"":k.call(a)}:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||n.guid++,e):void 0},now:function(){return+new Date},support:l}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s="sizzle"+-new Date,t=a.document,u=0,v=0,w=eb(),x=eb(),y=eb(),z=function(a,b){return a===b&&(j=!0),0},A="undefined",B=1<<31,C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=D.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",M=L.replace("w","w#"),N="\\["+K+"*("+L+")"+K+"*(?:([*^$|!~]?=)"+K+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+M+")|)|)"+K+"*\\]",O=":("+L+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+N.replace(3,8)+")*)|.*)\\)|)",P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(O),U=new RegExp("^"+M+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L.replace("w","w*")+")"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=/'|\\/g,ab=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),bb=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{G.apply(D=H.call(t.childNodes),t.childNodes),D[t.childNodes.length].nodeType}catch(cb){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function db(a,b,d,e){var f,g,h,i,j,m,p,q,u,v;if((b?b.ownerDocument||b:t)!==l&&k(b),b=b||l,d=d||[],!a||"string"!=typeof a)return d;if(1!==(i=b.nodeType)&&9!==i)return[];if(n&&!e){if(f=Z.exec(a))if(h=f[1]){if(9===i){if(g=b.getElementById(h),!g||!g.parentNode)return d;if(g.id===h)return d.push(g),d}else if(b.ownerDocument&&(g=b.ownerDocument.getElementById(h))&&r(b,g)&&g.id===h)return d.push(g),d}else{if(f[2])return G.apply(d,b.getElementsByTagName(a)),d;if((h=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(h)),d}if(c.qsa&&(!o||!o.test(a))){if(q=p=s,u=b,v=9===i&&a,1===i&&"object"!==b.nodeName.toLowerCase()){m=ob(a),(p=b.getAttribute("id"))?q=p.replace(_,"\\$&"):b.setAttribute("id",q),q="[id='"+q+"'] ",j=m.length;while(j--)m[j]=q+pb(m[j]);u=$.test(a)&&mb(b.parentNode)||b,v=m.join(",")}if(v)try{return G.apply(d,u.querySelectorAll(v)),d}catch(w){}finally{p||b.removeAttribute("id")}}}return xb(a.replace(P,"$1"),b,d,e)}function eb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function fb(a){return a[s]=!0,a}function gb(a){var b=l.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function hb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function ib(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||B)-(~a.sourceIndex||B);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function jb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function kb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function lb(a){return fb(function(b){return b=+b,fb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function mb(a){return a&&typeof a.getElementsByTagName!==A&&a}c=db.support={},f=db.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},k=db.setDocument=function(a){var b,e=a?a.ownerDocument||a:t,g=e.defaultView;return e!==l&&9===e.nodeType&&e.documentElement?(l=e,m=e.documentElement,n=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){k()},!1):g.attachEvent&&g.attachEvent("onunload",function(){k()})),c.attributes=gb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=gb(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(e.getElementsByClassName)&&gb(function(a){return a.innerHTML="
",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=gb(function(a){return m.appendChild(a).id=s,!e.getElementsByName||!e.getElementsByName(s).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==A&&n){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){var c=typeof a.getAttributeNode!==A&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==A?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==A&&n?b.getElementsByClassName(a):void 0},p=[],o=[],(c.qsa=Y.test(e.querySelectorAll))&&(gb(function(a){a.innerHTML="",a.querySelectorAll("[t^='']").length&&o.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||o.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll(":checked").length||o.push(":checked")}),gb(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&o.push("name"+K+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||o.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),o.push(",.*:")})),(c.matchesSelector=Y.test(q=m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&gb(function(a){c.disconnectedMatch=q.call(a,"div"),q.call(a,"[s!='']:x"),p.push("!=",O)}),o=o.length&&new RegExp(o.join("|")),p=p.length&&new RegExp(p.join("|")),b=Y.test(m.compareDocumentPosition),r=b||Y.test(m.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},z=b?function(a,b){if(a===b)return j=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===t&&r(t,a)?-1:b===e||b.ownerDocument===t&&r(t,b)?1:i?I.call(i,a)-I.call(i,b):0:4&d?-1:1)}:function(a,b){if(a===b)return j=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],k=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:i?I.call(i,a)-I.call(i,b):0;if(f===g)return ib(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)k.unshift(c);while(h[d]===k[d])d++;return d?ib(h[d],k[d]):h[d]===t?-1:k[d]===t?1:0},e):l},db.matches=function(a,b){return db(a,null,null,b)},db.matchesSelector=function(a,b){if((a.ownerDocument||a)!==l&&k(a),b=b.replace(S,"='$1']"),!(!c.matchesSelector||!n||p&&p.test(b)||o&&o.test(b)))try{var d=q.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return db(b,l,null,[a]).length>0},db.contains=function(a,b){return(a.ownerDocument||a)!==l&&k(a),r(a,b)},db.attr=function(a,b){(a.ownerDocument||a)!==l&&k(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!n):void 0;return void 0!==f?f:c.attributes||!n?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},db.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},db.uniqueSort=function(a){var b,d=[],e=0,f=0;if(j=!c.detectDuplicates,i=!c.sortStable&&a.slice(0),a.sort(z),j){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return i=null,a},e=db.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=db.selectors={cacheLength:50,createPseudo:fb,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ab,bb),a[3]=(a[4]||a[5]||"").replace(ab,bb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||db.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&db.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return V.CHILD.test(a[0])?null:(a[3]&&void 0!==a[4]?a[2]=a[4]:c&&T.test(c)&&(b=ob(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ab,bb).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=w[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&w(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==A&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=db.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),t=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&t){k=q[s]||(q[s]={}),j=k[a]||[],n=j[0]===u&&j[1],m=j[0]===u&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[u,n,m];break}}else if(t&&(j=(b[s]||(b[s]={}))[a])&&j[0]===u)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(t&&((l[s]||(l[s]={}))[a]=[u,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||db.error("unsupported pseudo: "+a);return e[s]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?fb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:fb(function(a){var b=[],c=[],d=g(a.replace(P,"$1"));return d[s]?fb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:fb(function(a){return function(b){return db(a,b).length>0}}),contains:fb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:fb(function(a){return U.test(a||"")||db.error("unsupported lang: "+a),a=a.replace(ab,bb).toLowerCase(),function(b){var c;do if(c=n?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===m},focus:function(a){return a===l.activeElement&&(!l.hasFocus||l.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:lb(function(){return[0]}),last:lb(function(a,b){return[b-1]}),eq:lb(function(a,b,c){return[0>c?c+b:c]}),even:lb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:lb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:lb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:lb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function qb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=v++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[u,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[s]||(b[s]={}),(h=i[d])&&h[0]===u&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function rb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function sb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function tb(a,b,c,d,e,f){return d&&!d[s]&&(d=tb(d)),e&&!e[s]&&(e=tb(e,f)),fb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||wb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:sb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=sb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=sb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ub(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],i=g||d.relative[" "],j=g?1:0,k=qb(function(a){return a===b},i,!0),l=qb(function(a){return I.call(b,a)>-1},i,!0),m=[function(a,c,d){return!g&&(d||c!==h)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>j;j++)if(c=d.relative[a[j].type])m=[qb(rb(m),c)];else{if(c=d.filter[a[j].type].apply(null,a[j].matches),c[s]){for(e=++j;f>e;e++)if(d.relative[a[e].type])break;return tb(j>1&&rb(m),j>1&&pb(a.slice(0,j-1).concat({value:" "===a[j-2].type?"*":""})).replace(P,"$1"),c,e>j&&ub(a.slice(j,e)),f>e&&ub(a=a.slice(e)),f>e&&pb(a))}m.push(c)}return rb(m)}function vb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,i,j,k){var m,n,o,p=0,q="0",r=f&&[],s=[],t=h,v=f||e&&d.find.TAG("*",k),w=u+=null==t?1:Math.random()||.1,x=v.length;for(k&&(h=g!==l&&g);q!==x&&null!=(m=v[q]);q++){if(e&&m){n=0;while(o=a[n++])if(o(m,g,i)){j.push(m);break}k&&(u=w)}c&&((m=!o&&m)&&p--,f&&r.push(m))}if(p+=q,c&&q!==p){n=0;while(o=b[n++])o(r,s,g,i);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=E.call(j));s=sb(s)}G.apply(j,s),k&&!f&&s.length>0&&p+b.length>1&&db.uniqueSort(j)}return k&&(u=w,h=t),r};return c?fb(f):f}g=db.compile=function(a,b){var c,d=[],e=[],f=y[a+" "];if(!f){b||(b=ob(a)),c=b.length;while(c--)f=ub(b[c]),f[s]?d.push(f):e.push(f);f=y(a,vb(e,d))}return f};function wb(a,b,c){for(var d=0,e=b.length;e>d;d++)db(a,b[d],c);return c}function xb(a,b,e,f){var h,i,j,k,l,m=ob(a);if(!f&&1===m.length){if(i=m[0]=m[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&c.getById&&9===b.nodeType&&n&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(ab,bb),b)||[])[0],!b)return e;a=a.slice(i.shift().value.length)}h=V.needsContext.test(a)?0:i.length;while(h--){if(j=i[h],d.relative[k=j.type])break;if((l=d.find[k])&&(f=l(j.matches[0].replace(ab,bb),$.test(i[0].type)&&mb(b.parentNode)||b))){if(i.splice(h,1),a=f.length&&pb(i),!a)return G.apply(e,f),e;break}}}return g(a,m)(f,b,!n,e,$.test(a)&&mb(b.parentNode)||b),e}return c.sortStable=s.split("").sort(z).join("")===s,c.detectDuplicates=!!j,k(),c.sortDetached=gb(function(a){return 1&a.compareDocumentPosition(l.createElement("div"))}),gb(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||hb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&gb(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||hb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),gb(function(a){return null==a.getAttribute("disabled")})||hb(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),db}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=a.document,A=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,B=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:A.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:z,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=z.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return y.find(a);this.length=1,this[0]=d}return this.context=z,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};B.prototype=n.fn,y=n(z);var C=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!n(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function E(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return E(a,"nextSibling")},prev:function(a){return E(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(D[a]||(e=n.unique(e)),C.test(a)&&(e=e.reverse())),this.pushStack(e)}});var F=/\S+/g,G={};function H(a){var b=G[a]={};return n.each(a.match(F)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?G[a]||H(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&n.each(arguments,function(a,c){var d;while((d=n.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){if(a===!0?!--n.readyWait:!n.isReady){if(!z.body)return setTimeout(n.ready);n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(z,[n]),n.fn.trigger&&n(z).trigger("ready").off("ready"))}}});function J(){z.addEventListener?(z.removeEventListener("DOMContentLoaded",K,!1),a.removeEventListener("load",K,!1)):(z.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(z.addEventListener||"load"===event.type||"complete"===z.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===z.readyState)setTimeout(n.ready);else if(z.addEventListener)z.addEventListener("DOMContentLoaded",K,!1),a.addEventListener("load",K,!1);else{z.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&z.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!n.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}J(),n.ready()}}()}return I.promise(b)};var L="undefined",M;for(M in n(l))break;l.ownLast="0"!==M,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c=z.getElementsByTagName("body")[0];c&&(a=z.createElement("div"),a.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",b=z.createElement("div"),c.appendChild(a).appendChild(b),typeof b.style.zoom!==L&&(b.style.cssText="border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1",(l.inlineBlockNeedsLayout=3===b.offsetWidth)&&(c.style.zoom=1)),c.removeChild(a),a=b=null)}),function(){var a=z.createElement("div");if(null==l.deleteExpando){l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}}a=null}(),n.acceptData=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(n.acceptData(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f }}function S(a,b,c){if(n.acceptData(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d]));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},X=/^(?:checkbox|radio)$/i;!function(){var a=z.createDocumentFragment(),b=z.createElement("div"),c=z.createElement("input");if(b.setAttribute("className","t"),b.innerHTML="
a",l.leadingWhitespace=3===b.firstChild.nodeType,l.tbody=!b.getElementsByTagName("tbody").length,l.htmlSerialize=!!b.getElementsByTagName("link").length,l.html5Clone="<:nav>"!==z.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,a.appendChild(c),l.appendChecked=c.checked,b.innerHTML="",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,a.appendChild(b),b.innerHTML="",l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){l.noCloneEvent=!1}),b.cloneNode(!0).click()),null==l.deleteExpando){l.deleteExpando=!0;try{delete b.test}catch(d){l.deleteExpando=!1}}a=b=c=null}(),function(){var b,c,d=z.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),l[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var Y=/^(?:input|select|textarea)$/i,Z=/^key/,$=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,ab=/^([^.]*)(?:\.(.+)|)$/;function bb(){return!0}function cb(){return!1}function db(){try{return z.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof n===L||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(F)||[""],h=b.length;while(h--)f=ab.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(F)||[""],j=b.length;while(j--)if(h=ab.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,m,o=[d||z],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||z,3!==d.nodeType&&8!==d.nodeType&&!_.test(p+n.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[n.expando]?b:new n.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),k=n.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!n.isWindow(d)){for(i=k.delegateType||p,_.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||z)&&o.push(l.defaultView||l.parentWindow||a)}m=0;while((h=o[m++])&&!b.isPropagationStopped())b.type=m>1?i:k.bindType||p,f=(n._data(h,"events")||{})[b.type]&&n._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&n.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&n.acceptData(d)&&g&&d[p]&&!n.isWindow(d)){l=d[g],l&&(d[g]=null),n.event.triggered=p;try{d[p]()}catch(r){}n.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((n.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?n(c,this).index(i)>=0:n.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),ib=/^\s+/,jb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,kb=/<([\w:]+)/,lb=/\s*$/g,sb={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:l.htmlSerialize?[0,"",""]:[1,"X
","
"]},tb=eb(z),ub=tb.appendChild(z.createElement("div"));sb.optgroup=sb.option,sb.tbody=sb.tfoot=sb.colgroup=sb.caption=sb.thead,sb.th=sb.td;function vb(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==L?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==L?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,vb(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function wb(a){X.test(a.type)&&(a.defaultChecked=a.checked)}function xb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function yb(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function zb(a){var b=qb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ab(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}function Bb(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Cb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(yb(b).text=a.text,zb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&X.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}n.extend({clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!hb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ub.innerHTML=a.outerHTML,ub.removeChild(f=ub.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=vb(f),h=vb(a),g=0;null!=(e=h[g]);++g)d[g]&&Cb(e,d[g]);if(b)if(c)for(h=h||vb(a),d=d||vb(f),g=0;null!=(e=h[g]);g++)Bb(e,d[g]);else Bb(a,f);return d=vb(f,"script"),d.length>0&&Ab(d,!i&&vb(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k,m=a.length,o=eb(b),p=[],q=0;m>q;q++)if(f=a[q],f||0===f)if("object"===n.type(f))n.merge(p,f.nodeType?[f]:f);else if(mb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(kb.exec(f)||["",""])[1].toLowerCase(),k=sb[i]||sb._default,h.innerHTML=k[1]+f.replace(jb,"<$1>")+k[2],e=k[0];while(e--)h=h.lastChild;if(!l.leadingWhitespace&&ib.test(f)&&p.push(b.createTextNode(ib.exec(f)[0])),!l.tbody){f="table"!==i||lb.test(f)?""!==k[1]||lb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)n.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}n.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),l.appendChecked||n.grep(vb(p,"input"),wb),q=0;while(f=p[q++])if((!d||-1===n.inArray(f,d))&&(g=n.contains(f.ownerDocument,f),h=vb(o.appendChild(f),"script"),g&&Ab(h),c)){e=0;while(f=h[e++])pb.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.deleteExpando,m=n.event.special;null!=(d=a[h]);h++)if((b||n.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k?delete d[i]:typeof d.removeAttribute!==L?d.removeAttribute(i):d[i]=null,c.push(f))}}}),n.fn.extend({text:function(a){return W(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||z).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(vb(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&Ab(vb(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(vb(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return W(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(gb,""):void 0;if(!("string"!=typeof a||nb.test(a)||!l.htmlSerialize&&hb.test(a)||!l.leadingWhitespace&&ib.test(a)||sb[(kb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(jb,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(vb(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(vb(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,k=this.length,m=this,o=k-1,p=a[0],q=n.isFunction(p);if(q||k>1&&"string"==typeof p&&!l.checkClone&&ob.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(k&&(i=n.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=n.map(vb(i,"script"),yb),f=g.length;k>j;j++)d=i,j!==o&&(d=n.clone(d,!0,!0),f&&n.merge(g,vb(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,n.map(g,zb),j=0;f>j;j++)d=g[j],pb.test(d.type||"")&&!n._data(d,"globalEval")&&n.contains(h,d)&&(d.src?n._evalUrl&&n._evalUrl(d.src):n.globalEval((d.text||d.textContent||d.innerHTML||"").replace(rb,"")));i=c=null}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],g=n(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Db,Eb={};function Fb(b,c){var d=n(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:n.css(d[0],"display");return d.detach(),e}function Gb(a){var b=z,c=Eb[a];return c||(c=Fb(a,b),"none"!==c&&c||(Db=(Db||n("', preload: true, css: {}, attr: { scrolling: "auto" }}, video: { tpl: '", format: "", autoStart: true }, defaultType: "image", animationEffect: "zoom", animationDuration: 366, zoomOpacity: "auto", transitionEffect: "fade", transitionDuration: 366, slideClass: "", baseClass: "", baseTpl: '", spinnerTpl: '
', errorTpl: '

{{ERROR}}

', btnTpl: { download: '' + '' + "", zoom: '", close: '", arrowLeft: '", arrowRight: '", smallBtn: '" }, parentEl: "body", hideScrollbar: true, autoFocus: true, backFocus: true, trapFocus: true, fullScreen: { autoStart: false }, touch: { vertical: true, momentum: true }, hash: null, media: {}, slideShow: { autoStart: false, speed: 3000 }, thumbs: { autoStart: false, hideOnClose: true, parentEl: ".fancybox-container", axis: "y" }, wheel: "auto", /* afterShow: function(instance, current){ console.info('Clicked element:'); console.info(current.opts.$orig); } */ onInit: $.noop, beforeLoad: $.noop, afterLoad: $.noop, beforeShow: $.noop, afterShow: $.noop, beforeClose: $.noop, afterClose: $.noop, onActivate: $.noop, onDeactivate: $.noop, clickContent: function(current, event){ return current.type==="image" ? "zoom":false; }, clickSlide: "close", clickOutside: "close", dblclickContent: false, dblclickSlide: false, dblclickOutside: false, mobile: { preventCaptionOverlap: false, idleTime: false, clickContent: function(current, event){ return current.type==="image" ? "toggleControls":false; }, clickSlide: function(current, event){ return current.type==="image" ? "toggleControls":"close"; }, dblclickContent: function(current, event){ return current.type==="image" ? "zoom":false; }, dblclickSlide: function(current, event){ return current.type==="image" ? "zoom":false; }}, lang: "en", i18n: { en: { CLOSE: "Close", NEXT: "Next", PREV: "Previous", ERROR: "The requested content cannot be loaded.
Please try again later.", PLAY_START: "Start slideshow", PLAY_STOP: "Pause slideshow", FULL_SCREEN: "Full screen", THUMBS: "Thumbnails", DOWNLOAD: "Download", SHARE: "Share", ZOOM: "Zoom" }, de: { CLOSE: "Schliessen", NEXT: "Weiter", PREV: "Zurück", ERROR: "Die angeforderten Daten konnten nicht geladen werden.
Bitte versuchen Sie es später nochmal.", PLAY_START: "Diaschau starten", PLAY_STOP: "Diaschau beenden", FULL_SCREEN: "Vollbild", THUMBS: "Vorschaubilder", DOWNLOAD: "Herunterladen", SHARE: "Teilen", ZOOM: "Maßstab" }} }; var $W=$(window); var $D=$(document); var called=0; var isQuery=function(obj){ return obj&&obj.hasOwnProperty&&obj instanceof $; }; var requestAFrame=(function(){ return ( window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || function(callback){ return window.setTimeout(callback, 1000 / 60); } ); })(); var cancelAFrame=(function(){ return ( window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || function(id){ window.clearTimeout(id); } ); })(); var transitionEnd=(function(){ var el=document.createElement("fakeelement"), t; var transitions={ transition: "transitionend", OTransition: "oTransitionEnd", MozTransition: "transitionend", WebkitTransition: "webkitTransitionEnd" }; for (t in transitions){ if(el.style[t]!==undefined){ return transitions[t]; }} return "transitionend"; })(); var forceRedraw=function($el){ return $el&&$el.length&&$el[0].offsetHeight; }; var mergeOpts=function(opts1, opts2){ var rez=$.extend(true, {}, opts1, opts2); $.each(opts2, function(key, value){ if($.isArray(value)){ rez[key]=value; }}); return rez; }; var inViewport=function(elem){ var elemCenter, rez; if(!elem||elem.ownerDocument!==document){ return false; } $(".fancybox-container").css("pointer-events", "none"); elemCenter={ x: elem.getBoundingClientRect().left + elem.offsetWidth / 2, y: elem.getBoundingClientRect().top + elem.offsetHeight / 2 }; rez=document.elementFromPoint(elemCenter.x, elemCenter.y)===elem; $(".fancybox-container").css("pointer-events", ""); return rez; }; var FancyBox=function(content, opts, index){ var self=this; self.opts=mergeOpts({index: index}, $.fancybox.defaults); if($.isPlainObject(opts)){ self.opts=mergeOpts(self.opts, opts); } if($.fancybox.isMobile){ self.opts=mergeOpts(self.opts, self.opts.mobile); } self.id=self.opts.id||++called; self.currIndex=parseInt(self.opts.index, 10)||0; self.prevIndex=null; self.prevPos=null; self.currPos=0; self.firstRun=true; self.group=[]; self.slides={}; self.addContent(content); if(!self.group.length){ return; } self.init(); }; $.extend(FancyBox.prototype, { init: function(){ var self=this, firstItem=self.group[self.currIndex], firstItemOpts=firstItem.opts, $container, buttonStr; if(firstItemOpts.closeExisting){ $.fancybox.close(true); } $("body").addClass("fancybox-active"); if(!$.fancybox.getInstance() && firstItemOpts.hideScrollbar!==false && !$.fancybox.isMobile && document.body.scrollHeight > window.innerHeight ){ $("head").append('" ); $("body").addClass("compensate-for-scrollbar"); } buttonStr=""; $.each(firstItemOpts.buttons, function(index, value){ buttonStr +=firstItemOpts.btnTpl[value]||""; }); $container=$( self.translate(self, firstItemOpts.baseTpl .replace("{{buttons}}", buttonStr) .replace("{{arrows}}", firstItemOpts.btnTpl.arrowLeft + firstItemOpts.btnTpl.arrowRight) ) ) .attr("id", "fancybox-container-" + self.id) .addClass(firstItemOpts.baseClass) .data("FancyBox", self) .appendTo(firstItemOpts.parentEl); self.$refs={ container: $container }; ["bg", "inner", "infobar", "toolbar", "stage", "caption", "navigation"].forEach(function(item){ self.$refs[item]=$container.find(".fancybox-" + item); }); self.trigger("onInit"); self.activate(); self.jumpTo(self.currIndex); }, translate: function(obj, str){ var arr=obj.opts.i18n[obj.opts.lang]||obj.opts.i18n.en; return str.replace(/\{\{(\w+)\}\}/g, function(match, n){ var value=arr[n]; if(value===undefined){ return match; } return value; }); }, addContent: function(content){ var self=this, items=$.makeArray(content), thumbs; $.each(items, function(i, item){ var obj={}, opts={}, $item, type, found, src, srcParts; if($.isPlainObject(item)){ obj=item; opts=item.opts||item; }else if($.type(item)==="object"&&$(item).length){ $item=$(item); opts=$item.data()||{}; opts=$.extend(true, {}, opts, opts.options); opts.$orig=$item; obj.src=self.opts.src||opts.src||$item.attr("href"); if(!obj.type&&!obj.src){ obj.type="inline"; obj.src=item; }}else{ obj={ type: "html", src: item + "" };} obj.opts=$.extend(true, {}, self.opts, opts); if($.isArray(opts.buttons)){ obj.opts.buttons=opts.buttons; } if($.fancybox.isMobile&&obj.opts.mobile){ obj.opts=mergeOpts(obj.opts, obj.opts.mobile); } type=obj.type||obj.opts.type; src=obj.src||""; if(!type&&src){ if((found=src.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))){ type="video"; if(!obj.opts.video.format){ obj.opts.video.format="video/" + (found[1]==="ogv" ? "ogg":found[1]); }}else if(src.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)){ type="image"; }else if(src.match(/\.(pdf)((\?|#).*)?$/i)){ type="iframe"; obj=$.extend(true, obj, {contentType: "pdf", opts: {iframe: {preload: false}}}); }else if(src.charAt(0)==="#"){ type="inline"; }} if(type){ obj.type=type; }else{ self.trigger("objectNeedsType", obj); } if(!obj.contentType){ obj.contentType=$.inArray(obj.type, ["html", "inline", "ajax"]) > -1 ? "html":obj.type; } obj.index=self.group.length; if(obj.opts.smallBtn=="auto"){ obj.opts.smallBtn=$.inArray(obj.type, ["html", "inline", "ajax"]) > -1; } if(obj.opts.toolbar==="auto"){ obj.opts.toolbar = !obj.opts.smallBtn; } obj.$thumb=obj.opts.$thumb||null; if(obj.opts.$trigger&&obj.index===self.opts.index){ obj.$thumb=obj.opts.$trigger.find("img:first"); if(obj.$thumb.length){ obj.opts.$orig=obj.opts.$trigger; }} if(!(obj.$thumb&&obj.$thumb.length)&&obj.opts.$orig){ obj.$thumb=obj.opts.$orig.find("img:first"); } if(obj.$thumb&&!obj.$thumb.length){ obj.$thumb=null; } obj.thumb=obj.opts.thumb||(obj.$thumb ? obj.$thumb[0].src:null); if($.type(obj.opts.caption)==="function"){ obj.opts.caption=obj.opts.caption.apply(item, [self, obj]); } if($.type(self.opts.caption)==="function"){ obj.opts.caption=self.opts.caption.apply(item, [self, obj]); } if(!(obj.opts.caption instanceof $)){ obj.opts.caption=obj.opts.caption===undefined ? "":obj.opts.caption + ""; } if(obj.type==="ajax"){ srcParts=src.split(/\s+/, 2); if(srcParts.length > 1){ obj.src=srcParts.shift(); obj.opts.filter=srcParts.shift(); }} if(obj.opts.modal){ obj.opts=$.extend(true, obj.opts, { trapFocus: true, infobar: 0, toolbar: 0, smallBtn: 0, keyboard: 0, slideShow: 0, fullScreen: 0, thumbs: 0, touch: 0, clickContent: false, clickSlide: false, clickOutside: false, dblclickContent: false, dblclickSlide: false, dblclickOutside: false }); } self.group.push(obj); }); if(Object.keys(self.slides).length){ self.updateControls(); thumbs=self.Thumbs; if(thumbs&&thumbs.isActive){ thumbs.create(); thumbs.focus(); }} }, addEvents: function(){ var self=this; self.removeEvents(); self.$refs.container .on("click.fb-close", "[data-fancybox-close]", function(e){ e.stopPropagation(); e.preventDefault(); self.close(e); }) .on("touchstart.fb-prev click.fb-prev", "[data-fancybox-prev]", function(e){ e.stopPropagation(); e.preventDefault(); self.previous(); }) .on("touchstart.fb-next click.fb-next", "[data-fancybox-next]", function(e){ e.stopPropagation(); e.preventDefault(); self.next(); }) .on("click.fb", "[data-fancybox-zoom]", function(e){ self[self.isScaledDown() ? "scaleToActual":"scaleToFit"](); }); $W.on("orientationchange.fb resize.fb", function(e){ if(e&&e.originalEvent&&e.originalEvent.type==="resize"){ if(self.requestId){ cancelAFrame(self.requestId); } self.requestId=requestAFrame(function(){ self.update(e); }); }else{ if(self.current&&self.current.type==="iframe"){ self.$refs.stage.hide(); } setTimeout(function(){ self.$refs.stage.show(); self.update(e); }, $.fancybox.isMobile ? 600:250); }}); $D.on("keydown.fb", function(e){ var instance=$.fancybox ? $.fancybox.getInstance():null, current=instance.current, keycode=e.keyCode||e.which; if(keycode==9){ if(current.opts.trapFocus){ self.focus(e); } return; } if(!current.opts.keyboard||e.ctrlKey||e.altKey||e.shiftKey||$(e.target).is("input")||$(e.target).is("textarea")){ return; } if(keycode===8||keycode===27){ e.preventDefault(); self.close(e); return; } if(keycode===37||keycode===38){ e.preventDefault(); self.previous(); return; } if(keycode===39||keycode===40){ e.preventDefault(); self.next(); return; } self.trigger("afterKeydown", e, keycode); }); if(self.group[self.currIndex].opts.idleTime){ self.idleSecondsCounter=0; $D.on("mousemove.fb-idle mouseleave.fb-idle mousedown.fb-idle touchstart.fb-idle touchmove.fb-idle scroll.fb-idle keydown.fb-idle", function(e){ self.idleSecondsCounter=0; if(self.isIdle){ self.showControls(); } self.isIdle=false; } ); self.idleInterval=window.setInterval(function(){ self.idleSecondsCounter++; if(self.idleSecondsCounter >=self.group[self.currIndex].opts.idleTime&&!self.isDragging){ self.isIdle=true; self.idleSecondsCounter=0; self.hideControls(); }}, 1000); }}, removeEvents: function(){ var self=this; $W.off("orientationchange.fb resize.fb"); $D.off("keydown.fb .fb-idle"); this.$refs.container.off(".fb-close .fb-prev .fb-next"); if(self.idleInterval){ window.clearInterval(self.idleInterval); self.idleInterval=null; }}, previous: function(duration){ return this.jumpTo(this.currPos - 1, duration); }, next: function(duration){ return this.jumpTo(this.currPos + 1, duration); }, jumpTo: function(pos, duration){ var self=this, groupLen=self.group.length, firstRun, isMoved, loop, current, previous, slidePos, stagePos, prop, diff; if(self.isDragging||self.isClosing||(self.isAnimating&&self.firstRun)){ return; } pos=parseInt(pos, 10); loop=self.current ? self.current.opts.loop:self.opts.loop; if(!loop&&(pos < 0||pos >=groupLen)){ return false; } firstRun=self.firstRun = !Object.keys(self.slides).length; previous=self.current; self.prevIndex=self.currIndex; self.prevPos=self.currPos; current=self.createSlide(pos); if(groupLen > 1){ if(loop||current.index < groupLen - 1){ self.createSlide(pos + 1); } if(loop||current.index > 0){ self.createSlide(pos - 1); }} self.current=current; self.currIndex=current.index; self.currPos=current.pos; self.trigger("beforeShow", firstRun); self.updateControls(); current.forcedDuration=undefined; if($.isNumeric(duration)){ current.forcedDuration=duration; }else{ duration=current.opts[firstRun ? "animationDuration":"transitionDuration"]; } duration=parseInt(duration, 10); isMoved=self.isMoved(current); current.$slide.addClass("fancybox-slide--current"); if(firstRun){ if(current.opts.animationEffect&&duration){ self.$refs.container.css("transition-duration", duration + "ms"); } self.$refs.container.addClass("fancybox-is-open").trigger("focus"); self.loadSlide(current); self.preload("image"); return; } slidePos=$.fancybox.getTranslate(previous.$slide); stagePos=$.fancybox.getTranslate(self.$refs.stage); $.each(self.slides, function(index, slide){ $.fancybox.stop(slide.$slide, true); }); if(previous.pos!==current.pos){ previous.isComplete=false; } previous.$slide.removeClass("fancybox-slide--complete fancybox-slide--current"); if(isMoved){ diff=slidePos.left - (previous.pos * slidePos.width + previous.pos * previous.opts.gutter); $.each(self.slides, function(index, slide){ slide.$slide.removeClass("fancybox-animated").removeClass(function(index, className){ return (className.match(/(^|\s)fancybox-fx-\S+/g)||[]).join(" "); }); var leftPos=slide.pos * slidePos.width + slide.pos * slide.opts.gutter; $.fancybox.setTranslate(slide.$slide, {top: 0, left: leftPos - stagePos.left + diff}); if(slide.pos!==current.pos){ slide.$slide.addClass("fancybox-slide--" + (slide.pos > current.pos ? "next":"previous")); } forceRedraw(slide.$slide); $.fancybox.animate(slide.$slide, { top: 0, left: (slide.pos - current.pos) * slidePos.width + (slide.pos - current.pos) * slide.opts.gutter }, duration, function(){ slide.$slide .css({ transform: "", opacity: "" }) .removeClass("fancybox-slide--next fancybox-slide--previous"); if(slide.pos===self.currPos){ self.complete(); }} ); }); }else if(duration&¤t.opts.transitionEffect){ prop="fancybox-animated fancybox-fx-" + current.opts.transitionEffect; previous.$slide.addClass("fancybox-slide--" + (previous.pos > current.pos ? "next":"previous")); $.fancybox.animate(previous.$slide, prop, duration, function(){ previous.$slide.removeClass(prop).removeClass("fancybox-slide--next fancybox-slide--previous"); }, false ); } if(current.isLoaded){ self.revealContent(current); }else{ self.loadSlide(current); } self.preload("image"); }, createSlide: function(pos){ var self=this, $slide, index; index=pos % self.group.length; index=index < 0 ? self.group.length + index:index; if(!self.slides[pos]&&self.group[index]){ $slide=$('
').appendTo(self.$refs.stage); self.slides[pos]=$.extend(true, {}, self.group[index], { pos: pos, $slide: $slide, isLoaded: false }); self.updateSlide(self.slides[pos]); } return self.slides[pos]; }, scaleToActual: function(x, y, duration){ var self=this, current=self.current, $content=current.$content, canvasWidth=$.fancybox.getTranslate(current.$slide).width, canvasHeight=$.fancybox.getTranslate(current.$slide).height, newImgWidth=current.width, newImgHeight=current.height, imgPos, posX, posY, scaleX, scaleY; if(self.isAnimating||self.isMoved()||!$content||!(current.type=="image"&¤t.isLoaded&&!current.hasError)){ return; } self.isAnimating=true; $.fancybox.stop($content); x=x===undefined ? canvasWidth * 0.5:x; y=y===undefined ? canvasHeight * 0.5:y; imgPos=$.fancybox.getTranslate($content); imgPos.top -=$.fancybox.getTranslate(current.$slide).top; imgPos.left -=$.fancybox.getTranslate(current.$slide).left; scaleX=newImgWidth / imgPos.width; scaleY=newImgHeight / imgPos.height; posX=canvasWidth * 0.5 - newImgWidth * 0.5; posY=canvasHeight * 0.5 - newImgHeight * 0.5; if(newImgWidth > canvasWidth){ posX=imgPos.left * scaleX - (x * scaleX - x); if(posX > 0){ posX=0; } if(posX < canvasWidth - newImgWidth){ posX=canvasWidth - newImgWidth; }} if(newImgHeight > canvasHeight){ posY=imgPos.top * scaleY - (y * scaleY - y); if(posY > 0){ posY=0; } if(posY < canvasHeight - newImgHeight){ posY=canvasHeight - newImgHeight; }} self.updateCursor(newImgWidth, newImgHeight); $.fancybox.animate($content, { top: posY, left: posX, scaleX: scaleX, scaleY: scaleY }, duration||330, function(){ self.isAnimating=false; } ); if(self.SlideShow&&self.SlideShow.isActive){ self.SlideShow.stop(); }}, scaleToFit: function(duration){ var self=this, current=self.current, $content=current.$content, end; if(self.isAnimating||self.isMoved()||!$content||!(current.type=="image"&¤t.isLoaded&&!current.hasError)){ return; } self.isAnimating=true; $.fancybox.stop($content); end=self.getFitPos(current); self.updateCursor(end.width, end.height); $.fancybox.animate($content, { top: end.top, left: end.left, scaleX: end.width / $content.width(), scaleY: end.height / $content.height() }, duration||330, function(){ self.isAnimating=false; } ); }, getFitPos: function(slide){ var self=this, $content=slide.$content, $slide=slide.$slide, width=slide.width||slide.opts.width, height=slide.height||slide.opts.height, maxWidth, maxHeight, minRatio, aspectRatio, rez={}; if(!slide.isLoaded||!$content||!$content.length){ return false; } maxWidth=$.fancybox.getTranslate(self.$refs.stage).width; maxHeight=$.fancybox.getTranslate(self.$refs.stage).height; maxWidth -= parseFloat($slide.css("paddingLeft")) + parseFloat($slide.css("paddingRight")) + parseFloat($content.css("marginLeft")) + parseFloat($content.css("marginRight")); maxHeight -= parseFloat($slide.css("paddingTop")) + parseFloat($slide.css("paddingBottom")) + parseFloat($content.css("marginTop")) + parseFloat($content.css("marginBottom")); if(!width||!height){ width=maxWidth; height=maxHeight; } minRatio=Math.min(1, maxWidth / width, maxHeight / height); width=minRatio * width; height=minRatio * height; if(width > maxWidth - 0.5){ width=maxWidth; } if(height > maxHeight - 0.5){ height=maxHeight; } if(slide.type==="image"){ rez.top=Math.floor((maxHeight - height) * 0.5) + parseFloat($slide.css("paddingTop")); rez.left=Math.floor((maxWidth - width) * 0.5) + parseFloat($slide.css("paddingLeft")); }else if(slide.contentType==="video"){ aspectRatio=slide.opts.width&&slide.opts.height ? width / height:slide.opts.ratio||16 / 9; if(height > width / aspectRatio){ height=width / aspectRatio; }else if(width > height * aspectRatio){ width=height * aspectRatio; }} rez.width=width; rez.height=height; return rez; }, update: function(e){ var self=this; $.each(self.slides, function(key, slide){ self.updateSlide(slide, e); }); }, updateSlide: function(slide, e){ var self=this, $content=slide&&slide.$content, width=slide.width||slide.opts.width, height=slide.height||slide.opts.height, $slide=slide.$slide; self.adjustCaption(slide); if($content&&(width||height||slide.contentType==="video")&&!slide.hasError){ $.fancybox.stop($content); $.fancybox.setTranslate($content, self.getFitPos(slide)); if(slide.pos===self.currPos){ self.isAnimating=false; self.updateCursor(); }} self.adjustLayout(slide); if($slide.length){ $slide.trigger("refresh"); if(slide.pos===self.currPos){ self.$refs.toolbar .add(self.$refs.navigation.find(".fancybox-button--arrow_right")) .toggleClass("compensate-for-scrollbar", $slide.get(0).scrollHeight > $slide.get(0).clientHeight); }} self.trigger("onUpdate", slide, e); }, centerSlide: function(duration){ var self=this, current=self.current, $slide=current.$slide; if(self.isClosing||!current){ return; } $slide.siblings().css({ transform: "", opacity: "" }); $slide .parent() .children() .removeClass("fancybox-slide--previous fancybox-slide--next"); $.fancybox.animate($slide, { top: 0, left: 0, opacity: 1 }, duration===undefined ? 0:duration, function(){ $slide.css({ transform: "", opacity: "" }); if(!current.isComplete){ self.complete(); }}, false ); }, isMoved: function(slide){ var current=slide||this.current, slidePos, stagePos; if(!current){ return false; } stagePos=$.fancybox.getTranslate(this.$refs.stage); slidePos=$.fancybox.getTranslate(current.$slide); return ( !current.$slide.hasClass("fancybox-animated") && (Math.abs(slidePos.top - stagePos.top) > 0.5||Math.abs(slidePos.left - stagePos.left) > 0.5) ); }, updateCursor: function(nextWidth, nextHeight){ var self=this, current=self.current, $container=self.$refs.container, canPan, isZoomable; if(!current||self.isClosing||!self.Guestures){ return; } $container.removeClass("fancybox-is-zoomable fancybox-can-zoomIn fancybox-can-zoomOut fancybox-can-swipe fancybox-can-pan"); canPan=self.canPan(nextWidth, nextHeight); isZoomable=canPan ? true:self.isZoomable(); $container.toggleClass("fancybox-is-zoomable", isZoomable); $("[data-fancybox-zoom]").prop("disabled", !isZoomable); if(canPan){ $container.addClass("fancybox-can-pan"); }else if(isZoomable && (current.opts.clickContent==="zoom"||($.isFunction(current.opts.clickContent)&¤t.opts.clickContent(current)=="zoom")) ){ $container.addClass("fancybox-can-zoomIn"); }else if(current.opts.touch&&(current.opts.touch.vertical||self.group.length > 1)&¤t.contentType!=="video"){ $container.addClass("fancybox-can-swipe"); }}, isZoomable: function(){ var self=this, current=self.current, fitPos; if(current&&!self.isClosing&¤t.type==="image"&&!current.hasError){ if(!current.isLoaded){ return true; } fitPos=self.getFitPos(current); if(fitPos&&(current.width > fitPos.width||current.height > fitPos.height)){ return true; }} return false; }, isScaledDown: function(nextWidth, nextHeight){ var self=this, rez=false, current=self.current, $content=current.$content; if(nextWidth!==undefined&&nextHeight!==undefined){ rez=nextWidth < current.width&&nextHeight < current.height; }else if($content){ rez=$.fancybox.getTranslate($content); rez=rez.width < current.width&&rez.height < current.height; } return rez; }, canPan: function(nextWidth, nextHeight){ var self=this, current=self.current, pos=null, rez=false; if(current.type==="image"&&(current.isComplete||(nextWidth&&nextHeight))&&!current.hasError){ rez=self.getFitPos(current); if(nextWidth!==undefined&&nextHeight!==undefined){ pos={width: nextWidth, height: nextHeight};}else if(current.isComplete){ pos=$.fancybox.getTranslate(current.$content); } if(pos&&rez){ rez=Math.abs(pos.width - rez.width) > 1.5||Math.abs(pos.height - rez.height) > 1.5; }} return rez; }, loadSlide: function(slide){ var self=this, type, $slide, ajaxLoad; if(slide.isLoading||slide.isLoaded){ return; } slide.isLoading=true; if(self.trigger("beforeLoad", slide)===false){ slide.isLoading=false; return false; } type=slide.type; $slide=slide.$slide; $slide .off("refresh") .trigger("onReset") .addClass(slide.opts.slideClass); switch (type){ case "image": self.setImage(slide); break; case "iframe": self.setIframe(slide); break; case "html": self.setContent(slide, slide.src||slide.content); break; case "video": self.setContent(slide, slide.opts.video.tpl .replace(/\{\{src\}\}/gi, slide.src) .replace("{{format}}", slide.opts.videoFormat||slide.opts.video.format||"") .replace("{{poster}}", slide.thumb||"") ); break; case "inline": if($(slide.src).length){ self.setContent(slide, $(slide.src)); }else{ self.setError(slide); } break; case "ajax": self.showLoading(slide); ajaxLoad=$.ajax($.extend({}, slide.opts.ajax.settings, { url: slide.src, success: function(data, textStatus){ if(textStatus==="success"){ self.setContent(slide, data); }}, error: function(jqXHR, textStatus){ if(jqXHR&&textStatus!=="abort"){ self.setError(slide); }} }) ); $slide.one("onReset", function(){ ajaxLoad.abort(); }); break; default: self.setError(slide); break; } return true; }, setImage: function(slide){ var self=this, ghost; setTimeout(function(){ var $img=slide.$image; if(!self.isClosing&&slide.isLoading&&(!$img||!$img.length||!$img[0].complete)&&!slide.hasError){ self.showLoading(slide); }}, 50); self.checkSrcset(slide); slide.$content=$('
') .addClass("fancybox-is-hidden") .appendTo(slide.$slide.addClass("fancybox-slide--image")); if(slide.opts.preload!==false&&slide.opts.width&&slide.opts.height&&slide.thumb){ slide.width=slide.opts.width; slide.height=slide.opts.height; ghost=document.createElement("img"); ghost.onerror=function(){ $(this).remove(); slide.$ghost=null; }; ghost.onload=function(){ self.afterLoad(slide); }; slide.$ghost=$(ghost) .addClass("fancybox-image") .appendTo(slide.$content) .attr("src", slide.thumb); } self.setBigImage(slide); }, checkSrcset: function(slide){ var srcset=slide.opts.srcset||slide.opts.image.srcset, found, temp, pxRatio, windowWidth; if(srcset){ pxRatio=window.devicePixelRatio||1; windowWidth=window.innerWidth * pxRatio; temp=srcset.split(",").map(function(el){ var ret={}; el.trim() .split(/\s+/) .forEach(function(el, i){ var value=parseInt(el.substring(0, el.length - 1), 10); if(i===0){ return (ret.url=el); } if(value){ ret.value=value; ret.postfix=el[el.length - 1]; }}); return ret; }); temp.sort(function(a, b){ return a.value - b.value; }); for (var j=0; j < temp.length; j++){ var el=temp[j]; if((el.postfix==="w"&&el.value >=windowWidth)||(el.postfix==="x"&&el.value >=pxRatio)){ found=el; break; }} if(!found&&temp.length){ found=temp[temp.length - 1]; } if(found){ slide.src=found.url; if(slide.width&&slide.height&&found.postfix=="w"){ slide.height=(slide.width / slide.height) * found.value; slide.width=found.value; } slide.opts.srcset=srcset; }} }, setBigImage: function(slide){ var self=this, img=document.createElement("img"), $img=$(img); slide.$image=$img .one("error", function(){ self.setError(slide); }) .one("load", function(){ var sizes; if(!slide.$ghost){ self.resolveImageSlideSize(slide, this.naturalWidth, this.naturalHeight); self.afterLoad(slide); } if(self.isClosing){ return; } if(slide.opts.srcset){ sizes=slide.opts.sizes; if(!sizes||sizes==="auto"){ sizes = (slide.width / slide.height > 1&&$W.width() / $W.height() > 1 ? "100":Math.round((slide.width / slide.height) * 100)) + "vw"; } $img.attr("sizes", sizes).attr("srcset", slide.opts.srcset); } if(slide.$ghost){ setTimeout(function(){ if(slide.$ghost&&!self.isClosing){ slide.$ghost.hide(); }}, Math.min(300, Math.max(1000, slide.height / 1600))); } self.hideLoading(slide); }) .addClass("fancybox-image") .attr("src", slide.src) .appendTo(slide.$content); if((img.complete||img.readyState=="complete")&&$img.naturalWidth&&$img.naturalHeight){ $img.trigger("load"); }else if(img.error){ $img.trigger("error"); }}, resolveImageSlideSize: function(slide, imgWidth, imgHeight){ var maxWidth=parseInt(slide.opts.width, 10), maxHeight=parseInt(slide.opts.height, 10); slide.width=imgWidth; slide.height=imgHeight; if(maxWidth > 0){ slide.width=maxWidth; slide.height=Math.floor((maxWidth * imgHeight) / imgWidth); } if(maxHeight > 0){ slide.width=Math.floor((maxHeight * imgWidth) / imgHeight); slide.height=maxHeight; }}, setIframe: function(slide){ var self=this, opts=slide.opts.iframe, $slide=slide.$slide, $iframe; if($.fancybox.isMobile){ opts.css.overflow="scroll"; } slide.$content=$('
') .css(opts.css) .appendTo($slide); $slide.addClass("fancybox-slide--" + slide.contentType); slide.$iframe=$iframe=$(opts.tpl.replace(/\{rnd\}/g, new Date().getTime())) .attr(opts.attr) .appendTo(slide.$content); if(opts.preload){ self.showLoading(slide); $iframe.on("load.fb error.fb", function(e){ this.isReady=1; slide.$slide.trigger("refresh"); self.afterLoad(slide); }); $slide.on("refresh.fb", function(){ var $content=slide.$content, frameWidth=opts.css.width, frameHeight=opts.css.height, $contents, $body; if($iframe[0].isReady!==1){ return; } try { $contents=$iframe.contents(); $body=$contents.find("body"); } catch (ignore){} if($body&&$body.length&&$body.children().length){ $slide.css("overflow", "visible"); $content.css({ width: "100%", "max-width": "100%", height: "9999px" }); if(frameWidth===undefined){ frameWidth=Math.ceil(Math.max($body[0].clientWidth, $body.outerWidth(true))); } $content.css("width", frameWidth ? frameWidth:"").css("max-width", ""); if(frameHeight===undefined){ frameHeight=Math.ceil(Math.max($body[0].clientHeight, $body.outerHeight(true))); } $content.css("height", frameHeight ? frameHeight:""); $slide.css("overflow", "auto"); } $content.removeClass("fancybox-is-hidden"); }); }else{ self.afterLoad(slide); } $iframe.attr("src", slide.src); $slide.one("onReset", function(){ try { $(this) .find("iframe") .hide() .unbind() .attr("src", "//about:blank"); } catch (ignore){} $(this) .off("refresh.fb") .empty(); slide.isLoaded=false; slide.isRevealed=false; }); }, setContent: function(slide, content){ var self=this; if(self.isClosing){ return; } self.hideLoading(slide); if(slide.$content){ $.fancybox.stop(slide.$content); } slide.$slide.empty(); if(isQuery(content)&&content.parent().length){ if(content.hasClass("fancybox-content")||content.parent().hasClass("fancybox-content")){ content.parents(".fancybox-slide").trigger("onReset"); } slide.$placeholder=$("
") .hide() .insertAfter(content); content.css("display", "inline-block"); }else if(!slide.hasError){ if($.type(content)==="string"){ content=$("
") .append($.trim(content)) .contents(); } if(slide.opts.filter){ content=$("
") .html(content) .find(slide.opts.filter); }} slide.$slide.one("onReset", function(){ $(this) .find("video,audio") .trigger("pause"); if(slide.$placeholder){ slide.$placeholder.after(content.removeClass("fancybox-content").hide()).remove(); slide.$placeholder=null; } if(slide.$smallBtn){ slide.$smallBtn.remove(); slide.$smallBtn=null; } if(!slide.hasError){ $(this).empty(); slide.isLoaded=false; slide.isRevealed=false; }}); $(content).appendTo(slide.$slide); if($(content).is("video,audio")){ $(content).addClass("fancybox-video"); $(content).wrap("
"); slide.contentType="video"; slide.opts.width=slide.opts.width||$(content).attr("width"); slide.opts.height=slide.opts.height||$(content).attr("height"); } slide.$content=slide.$slide .children() .filter("div,form,main,video,audio,article,.fancybox-content") .first(); slide.$content.siblings().hide(); if(!slide.$content.length){ slide.$content=slide.$slide .wrapInner("
") .children() .first(); } slide.$content.addClass("fancybox-content"); slide.$slide.addClass("fancybox-slide--" + slide.contentType); self.afterLoad(slide); }, setError: function(slide){ slide.hasError=true; slide.$slide .trigger("onReset") .removeClass("fancybox-slide--" + slide.contentType) .addClass("fancybox-slide--error"); slide.contentType="html"; this.setContent(slide, this.translate(slide, slide.opts.errorTpl)); if(slide.pos===this.currPos){ this.isAnimating=false; }}, showLoading: function(slide){ var self=this; slide=slide||self.current; if(slide&&!slide.$spinner){ slide.$spinner=$(self.translate(self, self.opts.spinnerTpl)) .appendTo(slide.$slide) .hide() .fadeIn("fast"); }}, hideLoading: function(slide){ var self=this; slide=slide||self.current; if(slide&&slide.$spinner){ slide.$spinner.stop().remove(); delete slide.$spinner; }}, afterLoad: function(slide){ var self=this; if(self.isClosing){ return; } slide.isLoading=false; slide.isLoaded=true; self.trigger("afterLoad", slide); self.hideLoading(slide); if(slide.opts.smallBtn&&(!slide.$smallBtn||!slide.$smallBtn.length)){ slide.$smallBtn=$(self.translate(slide, slide.opts.btnTpl.smallBtn)).appendTo(slide.$content); } if(slide.opts.protect&&slide.$content&&!slide.hasError){ slide.$content.on("contextmenu.fb", function(e){ if(e.button==2){ e.preventDefault(); } return true; }); if(slide.type==="image"){ $('
').appendTo(slide.$content); }} self.adjustCaption(slide); self.adjustLayout(slide); if(slide.pos===self.currPos){ self.updateCursor(); } self.revealContent(slide); }, adjustCaption: function(slide){ var self=this, current=slide||self.current, caption=current.opts.caption, $caption=self.$refs.caption, captionH=false; if(current.opts.preventCaptionOverlap&&caption&&caption.length){ if(current.pos!==self.currPos){ $caption=$caption .clone() .empty() .appendTo($caption.parent()); $caption.html(caption); captionH=$caption.outerHeight(true); $caption.empty().remove(); }else if(self.$caption){ captionH=self.$caption.outerHeight(true); } current.$slide.css("padding-bottom", captionH||""); }}, adjustLayout: function(slide){ var self=this, current=slide||self.current, scrollHeight, marginBottom, inlinePadding, actualPadding; if(current.isLoaded&¤t.opts.disableLayoutFix!==true){ current.$content.css("margin-bottom", ""); if(current.$content.outerHeight() > current.$slide.height() + 0.5){ inlinePadding=current.$slide[0].style["padding-bottom"]; actualPadding=current.$slide.css("padding-bottom"); if(parseFloat(actualPadding) > 0){ scrollHeight=current.$slide[0].scrollHeight; current.$slide.css("padding-bottom", 0); if(Math.abs(scrollHeight - current.$slide[0].scrollHeight) < 1){ marginBottom=actualPadding; } current.$slide.css("padding-bottom", inlinePadding); }} current.$content.css("margin-bottom", marginBottom); }}, revealContent: function(slide){ var self=this, $slide=slide.$slide, end=false, start=false, isMoved=self.isMoved(slide), isRevealed=slide.isRevealed, effect, effectClassName, duration, opacity; slide.isRevealed=true; effect=slide.opts[self.firstRun ? "animationEffect":"transitionEffect"]; duration=slide.opts[self.firstRun ? "animationDuration":"transitionDuration"]; duration=parseInt(slide.forcedDuration===undefined ? duration:slide.forcedDuration, 10); if(isMoved||slide.pos!==self.currPos||!duration){ effect=false; } if(effect==="zoom"){ if(slide.pos===self.currPos&&duration&&slide.type==="image"&&!slide.hasError&&(start=self.getThumbPos(slide))){ end=self.getFitPos(slide); }else{ effect="fade"; }} if(effect==="zoom"){ self.isAnimating=true; end.scaleX=end.width / start.width; end.scaleY=end.height / start.height; opacity=slide.opts.zoomOpacity; if(opacity=="auto"){ opacity=Math.abs(slide.width / slide.height - start.width / start.height) > 0.1; } if(opacity){ start.opacity=0.1; end.opacity=1; } $.fancybox.setTranslate(slide.$content.removeClass("fancybox-is-hidden"), start); forceRedraw(slide.$content); $.fancybox.animate(slide.$content, end, duration, function(){ self.isAnimating=false; self.complete(); }); return; } self.updateSlide(slide); if(!effect){ slide.$content.removeClass("fancybox-is-hidden"); if(!isRevealed&&isMoved&&slide.type==="image"&&!slide.hasError){ slide.$content.hide().fadeIn("fast"); } if(slide.pos===self.currPos){ self.complete(); } return; } $.fancybox.stop($slide); effectClassName="fancybox-slide--" + (slide.pos >=self.prevPos ? "next":"previous") + " fancybox-animated fancybox-fx-" + effect; $slide.addClass(effectClassName).removeClass("fancybox-slide--current"); slide.$content.removeClass("fancybox-is-hidden"); forceRedraw($slide); if(slide.type!=="image"){ slide.$content.hide().show(0); } $.fancybox.animate($slide, "fancybox-slide--current", duration, function(){ $slide.removeClass(effectClassName).css({ transform: "", opacity: "" }); if(slide.pos===self.currPos){ self.complete(); }}, true ); }, getThumbPos: function(slide){ var rez=false, $thumb=slide.$thumb, thumbPos, btw, brw, bbw, blw; if(!$thumb||!inViewport($thumb[0])){ return false; } thumbPos=$.fancybox.getTranslate($thumb); btw=parseFloat($thumb.css("border-top-width")||0); brw=parseFloat($thumb.css("border-right-width")||0); bbw=parseFloat($thumb.css("border-bottom-width")||0); blw=parseFloat($thumb.css("border-left-width")||0); rez={ top: thumbPos.top + btw, left: thumbPos.left + blw, width: thumbPos.width - brw - blw, height: thumbPos.height - btw - bbw, scaleX: 1, scaleY: 1 }; return thumbPos.width > 0&&thumbPos.height > 0 ? rez:false; }, complete: function(){ var self=this, current=self.current, slides={}, $el; if(self.isMoved()||!current.isLoaded){ return; } if(!current.isComplete){ current.isComplete=true; current.$slide.siblings().trigger("onReset"); self.preload("inline"); forceRedraw(current.$slide); current.$slide.addClass("fancybox-slide--complete"); $.each(self.slides, function(key, slide){ if(slide.pos >=self.currPos - 1&&slide.pos <=self.currPos + 1){ slides[slide.pos]=slide; }else if(slide){ $.fancybox.stop(slide.$slide); slide.$slide.off().remove(); }}); self.slides=slides; } self.isAnimating=false; self.updateCursor(); self.trigger("afterShow"); if(!!current.opts.video.autoStart){ current.$slide .find("video,audio") .filter(":visible:first") .trigger("play") .one("ended", function(){ if(this.webkitExitFullscreen){ this.webkitExitFullscreen(); } self.next(); }); } if(current.opts.autoFocus&¤t.contentType==="html"){ $el=current.$content.find("input[autofocus]:enabled:visible:first"); if($el.length){ $el.trigger("focus"); }else{ self.focus(null, true); }} current.$slide.scrollTop(0).scrollLeft(0); }, preload: function(type){ var self=this, prev, next; if(self.group.length < 2){ return; } next=self.slides[self.currPos + 1]; prev=self.slides[self.currPos - 1]; if(prev&&prev.type===type){ self.loadSlide(prev); } if(next&&next.type===type){ self.loadSlide(next); }}, focus: function(e, firstRun){ var self=this, focusableStr=[ "a[href]", "area[href]", 'input:not([disabled]):not([type="hidden"]):not([aria-hidden])', "select:not([disabled]):not([aria-hidden])", "textarea:not([disabled]):not([aria-hidden])", "button:not([disabled]):not([aria-hidden])", "iframe", "object", "embed", "[contenteditable]", '[tabindex]:not([tabindex^="-"])' ].join(","), focusableItems, focusedItemIndex; if(self.isClosing){ return; } if(e||!self.current||!self.current.isComplete){ focusableItems=self.$refs.container.find("*:visible"); }else{ focusableItems=self.current.$slide.find("*:visible" + (firstRun ? ":not(.fancybox-close-small)":"")); } focusableItems=focusableItems.filter(focusableStr).filter(function(){ return $(this).css("visibility")!=="hidden"&&!$(this).hasClass("disabled"); }); if(focusableItems.length){ focusedItemIndex=focusableItems.index(document.activeElement); if(e&&e.shiftKey){ if(focusedItemIndex < 0||focusedItemIndex==0){ e.preventDefault(); focusableItems.eq(focusableItems.length - 1).trigger("focus"); }}else{ if(focusedItemIndex < 0||focusedItemIndex==focusableItems.length - 1){ if(e){ e.preventDefault(); } focusableItems.eq(0).trigger("focus"); }} }else{ self.$refs.container.trigger("focus"); }}, activate: function(){ var self=this; $(".fancybox-container").each(function(){ var instance=$(this).data("FancyBox"); if(instance&&instance.id!==self.id&&!instance.isClosing){ instance.trigger("onDeactivate"); instance.removeEvents(); instance.isVisible=false; }}); self.isVisible=true; if(self.current||self.isIdle){ self.update(); self.updateControls(); } self.trigger("onActivate"); self.addEvents(); }, close: function(e, d){ var self=this, current=self.current, effect, duration, $content, domRect, opacity, start, end; var done=function(){ self.cleanUp(e); }; if(self.isClosing){ return false; } self.isClosing=true; if(self.trigger("beforeClose", e)===false){ self.isClosing=false; requestAFrame(function(){ self.update(); }); return false; } self.removeEvents(); $content=current.$content; effect=current.opts.animationEffect; duration=$.isNumeric(d) ? d:effect ? current.opts.animationDuration:0; current.$slide.removeClass("fancybox-slide--complete fancybox-slide--next fancybox-slide--previous fancybox-animated"); if(e!==true){ $.fancybox.stop(current.$slide); }else{ effect=false; } current.$slide .siblings() .trigger("onReset") .remove(); if(duration){ self.$refs.container .removeClass("fancybox-is-open") .addClass("fancybox-is-closing") .css("transition-duration", duration + "ms"); } self.hideLoading(current); self.hideControls(true); self.updateCursor(); if(effect==="zoom" && !($content&&duration&¤t.type==="image"&&!self.isMoved()&&!current.hasError&&(end=self.getThumbPos(current))) ){ effect="fade"; } if(effect==="zoom"){ $.fancybox.stop($content); domRect=$.fancybox.getTranslate($content); start={ top: domRect.top, left: domRect.left, scaleX: domRect.width / end.width, scaleY: domRect.height / end.height, width: end.width, height: end.height }; opacity=current.opts.zoomOpacity; if(opacity=="auto"){ opacity=Math.abs(current.width / current.height - end.width / end.height) > 0.1; } if(opacity){ end.opacity=0; } $.fancybox.setTranslate($content, start); forceRedraw($content); $.fancybox.animate($content, end, duration, done); return true; } if(effect&&duration){ $.fancybox.animate(current.$slide.addClass("fancybox-slide--previous").removeClass("fancybox-slide--current"), "fancybox-animated fancybox-fx-" + effect, duration, done ); }else{ if(e===true){ setTimeout(done, duration); }else{ done(); }} return true; }, cleanUp: function(e){ var self=this, instance, $focus=self.current.opts.$orig, x, y; self.current.$slide.trigger("onReset"); self.$refs.container.empty().remove(); self.trigger("afterClose", e); if(!!self.current.opts.backFocus){ if(!$focus||!$focus.length||!$focus.is(":visible")){ $focus=self.$trigger; } if($focus&&$focus.length){ x=window.scrollX; y=window.scrollY; $focus.trigger("focus"); $("html, body") .scrollTop(y) .scrollLeft(x); }} self.current=null; instance=$.fancybox.getInstance(); if(instance){ instance.activate(); }else{ $("body").removeClass("fancybox-active compensate-for-scrollbar"); $("#fancybox-style-noscroll").remove(); }}, trigger: function(name, slide){ var args=Array.prototype.slice.call(arguments, 1), self=this, obj=slide&&slide.opts ? slide:self.current, rez; if(obj){ args.unshift(obj); }else{ obj=self; } args.unshift(self); if($.isFunction(obj.opts[name])){ rez=obj.opts[name].apply(obj, args); } if(rez===false){ return rez; } if(name==="afterClose"||!self.$refs){ $D.trigger(name + ".fb", args); }else{ self.$refs.container.trigger(name + ".fb", args); }}, updateControls: function(){ var self=this, current=self.current, index=current.index, $container=self.$refs.container, $caption=self.$refs.caption, caption=current.opts.caption; current.$slide.trigger("refresh"); self.$caption=caption&&caption.length ? $caption.html(caption):null; if(!self.hasHiddenControls&&!self.isIdle){ self.showControls(); } $container.find("[data-fancybox-count]").html(self.group.length); $container.find("[data-fancybox-index]").html(index + 1); $container.find("[data-fancybox-prev]").prop("disabled", !current.opts.loop&&index <=0); $container.find("[data-fancybox-next]").prop("disabled", !current.opts.loop&&index >=self.group.length - 1); if(current.type==="image"){ $container .find("[data-fancybox-zoom]") .show() .end() .find("[data-fancybox-download]") .attr("href", current.opts.image.src||current.src) .show(); }else if(current.opts.toolbar){ $container.find("[data-fancybox-download],[data-fancybox-zoom]").hide(); } if($(document.activeElement).is(":hidden,[disabled]")){ self.$refs.container.trigger("focus"); }}, hideControls: function(andCaption){ var self=this, arr=["infobar", "toolbar", "nav"]; if(andCaption||!self.current.opts.preventCaptionOverlap){ arr.push("caption"); } this.$refs.container.removeClass(arr .map(function(i){ return "fancybox-show-" + i; }) .join(" ") ); this.hasHiddenControls=true; }, showControls: function(){ var self=this, opts=self.current ? self.current.opts:self.opts, $container=self.$refs.container; self.hasHiddenControls=false; self.idleSecondsCounter=0; $container .toggleClass("fancybox-show-toolbar", !!(opts.toolbar&&opts.buttons)) .toggleClass("fancybox-show-infobar", !!(opts.infobar&&self.group.length > 1)) .toggleClass("fancybox-show-caption", !!self.$caption) .toggleClass("fancybox-show-nav", !!(opts.arrows&&self.group.length > 1)) .toggleClass("fancybox-is-modal", !!opts.modal); }, toggleControls: function(){ if(this.hasHiddenControls){ this.showControls(); }else{ this.hideControls(); }} }); $.fancybox={ version: "3.5.2", defaults: defaults, getInstance: function(command){ var instance=$('.fancybox-container:not(".fancybox-is-closing"):last').data("FancyBox"), args=Array.prototype.slice.call(arguments, 1); if(instance instanceof FancyBox){ if($.type(command)==="string"){ instance[command].apply(instance, args); }else if($.type(command)==="function"){ command.apply(instance, args); } return instance; } return false; }, open: function(items, opts, index){ return new FancyBox(items, opts, index); }, close: function(all){ var instance=this.getInstance(); if(instance){ instance.close(); if(all===true){ this.close(all); }} }, destroy: function(){ this.close(true); $D.add("body").off("click.fb-start", "**"); }, isMobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), use3d: (function(){ var div=document.createElement("div"); return ( window.getComputedStyle && window.getComputedStyle(div) && window.getComputedStyle(div).getPropertyValue("transform") && !(document.documentMode&&document.documentMode < 11) ); })(), getTranslate: function($el){ var domRect; if(!$el||!$el.length){ return false; } domRect=$el[0].getBoundingClientRect(); return { top: domRect.top||0, left: domRect.left||0, width: domRect.width, height: domRect.height, opacity: parseFloat($el.css("opacity")) };}, setTranslate: function($el, props){ var str="", css={}; if(!$el||!props){ return; } if(props.left!==undefined||props.top!==undefined){ str = (props.left===undefined ? $el.position().left:props.left) + "px, " + (props.top===undefined ? $el.position().top:props.top) + "px"; if(this.use3d){ str="translate3d(" + str + ", 0px)"; }else{ str="translate(" + str + ")"; }} if(props.scaleX!==undefined&&props.scaleY!==undefined){ str +=" scale(" + props.scaleX + ", " + props.scaleY + ")"; }else if(props.scaleX!==undefined){ str +=" scaleX(" + props.scaleX + ")"; } if(str.length){ css.transform=str; } if(props.opacity!==undefined){ css.opacity=props.opacity; } if(props.width!==undefined){ css.width=props.width; } if(props.height!==undefined){ css.height=props.height; } return $el.css(css); }, animate: function($el, to, duration, callback, leaveAnimationName){ var self=this, from; if($.isFunction(duration)){ callback=duration; duration=null; } self.stop($el); from=self.getTranslate($el); $el.on(transitionEnd, function(e){ if(e&&e.originalEvent&&(!$el.is(e.originalEvent.target)||e.originalEvent.propertyName=="z-index")){ return; } self.stop($el); if($.isNumeric(duration)){ $el.css("transition-duration", ""); } if($.isPlainObject(to)){ if(to.scaleX!==undefined&&to.scaleY!==undefined){ self.setTranslate($el, { top: to.top, left: to.left, width: from.width * to.scaleX, height: from.height * to.scaleY, scaleX: 1, scaleY: 1 }); }}else if(leaveAnimationName!==true){ $el.removeClass(to); } if($.isFunction(callback)){ callback(e); }}); if($.isNumeric(duration)){ $el.css("transition-duration", duration + "ms"); } if($.isPlainObject(to)){ if(to.scaleX!==undefined&&to.scaleY!==undefined){ delete to.width; delete to.height; if($el.parent().hasClass("fancybox-slide--image")){ $el.parent().addClass("fancybox-is-scaling"); }} $.fancybox.setTranslate($el, to); }else{ $el.addClass(to); } $el.data("timer", setTimeout(function(){ $el.trigger(transitionEnd); }, duration + 33) ); }, stop: function($el, callCallback){ if($el&&$el.length){ clearTimeout($el.data("timer")); if(callCallback){ $el.trigger(transitionEnd); } $el.off(transitionEnd).css("transition-duration", ""); $el.parent().removeClass("fancybox-is-scaling"); }} }; function _run(e, opts){ var items=[], index=0, $target, value, instance; if(e&&e.isDefaultPrevented()){ return; } e.preventDefault(); opts=opts||{}; if(e&&e.data){ opts=mergeOpts(e.data.options, opts); } $target=opts.$target||$(e.currentTarget).trigger("blur"); instance=$.fancybox.getInstance(); if(instance&&instance.$trigger&&instance.$trigger.is($target)){ return; } if(opts.selector){ items=$(opts.selector); }else{ value=$target.attr("data-fancybox")||""; if(value){ items=e.data ? e.data.items:[]; items=items.length ? items.filter('[data-fancybox="' + value + '"]'):$('[data-fancybox="' + value + '"]'); }else{ items=[$target]; }} index=$(items).index($target); if(index < 0){ index=0; } instance=$.fancybox.open(items, opts, index); instance.$trigger=$target; } $.fn.fancybox=function(options){ var selector; options=options||{}; selector=options.selector||false; if(selector){ $("body") .off("click.fb-start", selector) .on("click.fb-start", selector, {options: options}, _run); }else{ this.off("click.fb-start").on("click.fb-start", { items: this, options: options }, _run ); } return this; }; $D.on("click.fb-start", "[data-fancybox]", _run); $D.on("click.fb-start", "[data-fancybox-trigger]", function(e){ $('[data-fancybox="' + $(this).attr("data-fancybox-trigger") + '"]') .eq($(this).attr("data-fancybox-index")||0) .trigger("click.fb-start", { $trigger: $(this) }); }); (function(){ var buttonStr=".fancybox-button", focusStr="fancybox-focus", $pressed=null; $D.on("mousedown mouseup focus blur", buttonStr, function(e){ switch (e.type){ case "mousedown": $pressed=$(this); break; case "mouseup": $pressed=null; break; case "focusin": $(buttonStr).removeClass(focusStr); if(!$(this).is($pressed)&&!$(this).is("[disabled]")){ $(this).addClass(focusStr); } break; case "focusout": $(buttonStr).removeClass(focusStr); break; }}); })(); })(window, document, jQuery); (function($){ "use strict"; var defaults={ youtube: { matcher: /(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(watch\?(.*&)?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*))(.*)/i, params: { autoplay: 1, autohide: 1, fs: 1, rel: 0, hd: 1, wmode: "transparent", enablejsapi: 1, html5: 1 }, paramPlace: 8, type: "iframe", url: "//www.youtube-nocookie.com/embed/$4", thumb: "//img.youtube.com/vi/$4/hqdefault.jpg" }, vimeo: { matcher: /^.+vimeo.com\/(.*\/)?([\d]+)(.*)?/, params: { autoplay: 1, hd: 1, show_title: 1, show_byline: 1, show_portrait: 0, fullscreen: 1 }, paramPlace: 3, type: "iframe", url: "//player.vimeo.com/video/$2" }, instagram: { matcher: /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i, type: "image", url: "//$1/p/$2/media/?size=l" }, gmap_place: { matcher: /(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(((maps\/(place\/(.*)\/)?\@(.*),(\d+.?\d+?)z))|(\?ll=))(.*)?/i, type: "iframe", url: function(rez){ return ( "//maps.google." + rez[2] + "/?ll=" + (rez[9] ? rez[9] + "&z=" + Math.floor(rez[10]) + (rez[12] ? rez[12].replace(/^\//, "&"):""):rez[12] + "").replace(/\?/, "&") + "&output=" + (rez[12]&&rez[12].indexOf("layer=c") > 0 ? "svembed":"embed") ); }}, gmap_search: { matcher: /(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(maps\/search\/)(.*)/i, type: "iframe", url: function(rez){ return "//maps.google." + rez[2] + "/maps?q=" + rez[5].replace("query=", "q=").replace("api=1", "") + "&output=embed"; }} }; var format=function(url, rez, params){ if(!url){ return; } params=params||""; if($.type(params)==="object"){ params=$.param(params, true); } $.each(rez, function(key, value){ url=url.replace("$" + key, value||""); }); if(params.length){ url +=(url.indexOf("?") > 0 ? "&":"?") + params; } return url; }; $(document).on("objectNeedsType.fb", function(e, instance, item){ var url=item.src||"", type=false, media, thumb, rez, params, urlParams, paramObj, provider; media=$.extend(true, {}, defaults, item.opts.media); $.each(media, function(providerName, providerOpts){ rez=url.match(providerOpts.matcher); if(!rez){ return; } type=providerOpts.type; provider=providerName; paramObj={}; if(providerOpts.paramPlace&&rez[providerOpts.paramPlace]){ urlParams=rez[providerOpts.paramPlace]; if(urlParams[0]=="?"){ urlParams=urlParams.substring(1); } urlParams=urlParams.split("&"); for (var m=0; m < urlParams.length; ++m){ var p=urlParams[m].split("=", 2); if(p.length==2){ paramObj[p[0]]=decodeURIComponent(p[1].replace(/\+/g, " ")); }} } params=$.extend(true, {}, providerOpts.params, item.opts[providerName], paramObj); url = $.type(providerOpts.url)==="function" ? providerOpts.url.call(this, rez, params, item):format(providerOpts.url, rez, params); thumb = $.type(providerOpts.thumb)==="function" ? providerOpts.thumb.call(this, rez, params, item):format(providerOpts.thumb, rez); if(providerName==="youtube"){ url=url.replace(/&t=((\d+)m)?(\d+)s/, function(match, p1, m, s){ return "&start=" + ((m ? parseInt(m, 10) * 60:0) + parseInt(s, 10)); }); }else if(providerName==="vimeo"){ url=url.replace("&%23", "#"); } return false; }); if(type){ if(!item.opts.thumb&&!(item.opts.$thumb&&item.opts.$thumb.length)){ item.opts.thumb=thumb; } if(type==="iframe"){ item.opts=$.extend(true, item.opts, { iframe: { preload: false, attr: { scrolling: "no" }} }); } $.extend(item, { type: type, src: url, origSrc: item.src, contentSource: provider, contentType: type==="image" ? "image":provider=="gmap_place"||provider=="gmap_search" ? "map":"video" }); }else if(url){ item.type=item.opts.defaultType; }}); var VideoAPILoader={ youtube: { src: "https://www.youtube.com/iframe_api", class: "YT", loading: false, loaded: false }, vimeo: { src: "https://player.vimeo.com/api/player.js", class: "Vimeo", loading: false, loaded: false }, load: function(vendor){ var _this=this, script; if(this[vendor].loaded){ setTimeout(function(){ _this.done(vendor); }); return; } if(this[vendor].loading){ return; } this[vendor].loading=true; script=document.createElement("script"); script.type="text/javascript"; script.src=this[vendor].src; if(vendor==="youtube"){ window.onYouTubeIframeAPIReady=function(){ _this[vendor].loaded=true; _this.done(vendor); };}else{ script.onload=function(){ _this[vendor].loaded=true; _this.done(vendor); };} document.body.appendChild(script); }, done: function(vendor){ var instance, $el, player; if(vendor==="youtube"){ delete window.onYouTubeIframeAPIReady; } instance=$.fancybox.getInstance(); if(instance){ $el=instance.current.$content.find("iframe"); if(vendor==="youtube"&&YT!==undefined&&YT){ player=new YT.Player($el.attr("id"), { events: { onStateChange: function(e){ if(e.data==0){ instance.next(); }} }}); }else if(vendor==="vimeo"&&Vimeo!==undefined&&Vimeo){ player=new Vimeo.Player($el); player.on("ended", function(){ instance.next(); }); }} }}; $(document).on({ "afterShow.fb": function(e, instance, current){ if(instance.group.length > 1&&(current.contentSource==="youtube"||current.contentSource==="vimeo")){ VideoAPILoader.load(current.contentSource); }} }); })(jQuery); (function(window, document, $){ "use strict"; var requestAFrame=(function(){ return ( window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || function(callback){ return window.setTimeout(callback, 1000 / 60); } ); })(); var cancelAFrame=(function(){ return ( window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || function(id){ window.clearTimeout(id); } ); })(); var getPointerXY=function(e){ var result=[]; e=e.originalEvent||e || window.e; e=e.touches&&e.touches.length ? e.touches:e.changedTouches&&e.changedTouches.length ? e.changedTouches:[e]; for (var key in e){ if(e[key].pageX){ result.push({ x: e[key].pageX, y: e[key].pageY }); }else if(e[key].clientX){ result.push({ x: e[key].clientX, y: e[key].clientY }); }} return result; }; var distance=function(point2, point1, what){ if(!point1||!point2){ return 0; } if(what==="x"){ return point2.x - point1.x; }else if(what==="y"){ return point2.y - point1.y; } return Math.sqrt(Math.pow(point2.x - point1.x, 2) + Math.pow(point2.y - point1.y, 2)); }; var isClickable=function($el){ if($el.is('a,area,button,[role="button"],input,label,select,summary,textarea,video,audio,iframe') || $.isFunction($el.get(0).onclick) || $el.data("selectable") ){ return true; } for (var i=0, atts=$el[0].attributes, n=atts.length; i < n; i++){ if(atts[i].nodeName.substr(0, 14)==="data-fancybox-"){ return true; }} return false; }; var hasScrollbars=function(el){ var overflowY=window.getComputedStyle(el)["overflow-y"], overflowX=window.getComputedStyle(el)["overflow-x"], vertical=(overflowY==="scroll"||overflowY==="auto")&&el.scrollHeight > el.clientHeight, horizontal=(overflowX==="scroll"||overflowX==="auto")&&el.scrollWidth > el.clientWidth; return vertical||horizontal; }; var isScrollable=function($el){ var rez=false; while (true){ rez=hasScrollbars($el.get(0)); if(rez){ break; } $el=$el.parent(); if(!$el.length||$el.hasClass("fancybox-stage")||$el.is("body")){ break; }} return rez; }; var Guestures=function(instance){ var self=this; self.instance=instance; self.$bg=instance.$refs.bg; self.$stage=instance.$refs.stage; self.$container=instance.$refs.container; self.destroy(); self.$container.on("touchstart.fb.touch mousedown.fb.touch", $.proxy(self, "ontouchstart")); }; Guestures.prototype.destroy=function(){ var self=this; self.$container.off(".fb.touch"); $(document).off(".fb.touch"); if(self.requestId){ cancelAFrame(self.requestId); self.requestId=null; } if(self.tapped){ clearTimeout(self.tapped); self.tapped=null; }}; Guestures.prototype.ontouchstart=function(e){ var self=this, $target=$(e.target), instance=self.instance, current=instance.current, $slide=current.$slide, $content=current.$content, isTouchDevice=e.type=="touchstart"; if(isTouchDevice){ self.$container.off("mousedown.fb.touch"); } if(e.originalEvent&&e.originalEvent.button==2){ return; } if(!$slide.length||!$target.length||isClickable($target)||isClickable($target.parent())){ return; } if(!$target.is("img")&&e.originalEvent.clientX > $target[0].clientWidth + $target.offset().left){ return; } if(!current||instance.isAnimating||current.$slide.hasClass("fancybox-animated")){ e.stopPropagation(); e.preventDefault(); return; } self.realPoints=self.startPoints=getPointerXY(e); if(!self.startPoints.length){ return; } if(current.touch){ e.stopPropagation(); } self.startEvent=e; self.canTap=true; self.$target=$target; self.$content=$content; self.opts=current.opts.touch; self.isPanning=false; self.isSwiping=false; self.isZooming=false; self.isScrolling=false; self.canPan=instance.canPan(); self.startTime=new Date().getTime(); self.distanceX=self.distanceY=self.distance=0; self.canvasWidth=Math.round($slide[0].clientWidth); self.canvasHeight=Math.round($slide[0].clientHeight); self.contentLastPos=null; self.contentStartPos=$.fancybox.getTranslate(self.$content)||{top: 0, left: 0}; self.sliderStartPos=$.fancybox.getTranslate($slide); self.stagePos=$.fancybox.getTranslate(instance.$refs.stage); self.sliderStartPos.top -=self.stagePos.top; self.sliderStartPos.left -=self.stagePos.left; self.contentStartPos.top -=self.stagePos.top; self.contentStartPos.left -=self.stagePos.left; $(document) .off(".fb.touch") .on(isTouchDevice ? "touchend.fb.touch touchcancel.fb.touch":"mouseup.fb.touch mouseleave.fb.touch", $.proxy(self, "ontouchend")) .on(isTouchDevice ? "touchmove.fb.touch":"mousemove.fb.touch", $.proxy(self, "ontouchmove")); if($.fancybox.isMobile){ document.addEventListener("scroll", self.onscroll, true); } if(!(self.opts||self.canPan)||!($target.is(self.$stage)||self.$stage.find($target).length)){ if($target.is(".fancybox-image")){ e.preventDefault(); } if(!($.fancybox.isMobile&&$target.hasClass("fancybox-caption"))){ return; }} self.isScrollable=isScrollable($target)||isScrollable($target.parent()); if(!($.fancybox.isMobile&&self.isScrollable)){ e.preventDefault(); } if(self.startPoints.length===1||current.hasError){ if(self.canPan){ $.fancybox.stop(self.$content); self.isPanning=true; }else{ self.isSwiping=true; } self.$container.addClass("fancybox-is-grabbing"); } if(self.startPoints.length===2&¤t.type==="image"&&(current.isLoaded||current.$ghost)){ self.canTap=false; self.isSwiping=false; self.isPanning=false; self.isZooming=true; $.fancybox.stop(self.$content); self.centerPointStartX=(self.startPoints[0].x + self.startPoints[1].x) * 0.5 - $(window).scrollLeft(); self.centerPointStartY=(self.startPoints[0].y + self.startPoints[1].y) * 0.5 - $(window).scrollTop(); self.percentageOfImageAtPinchPointX=(self.centerPointStartX - self.contentStartPos.left) / self.contentStartPos.width; self.percentageOfImageAtPinchPointY=(self.centerPointStartY - self.contentStartPos.top) / self.contentStartPos.height; self.startDistanceBetweenFingers=distance(self.startPoints[0], self.startPoints[1]); }}; Guestures.prototype.onscroll=function(e){ var self=this; self.isScrolling=true; document.removeEventListener("scroll", self.onscroll, true); }; Guestures.prototype.ontouchmove=function(e){ var self=this; if(e.originalEvent.buttons!==undefined&&e.originalEvent.buttons===0){ self.ontouchend(e); return; } if(self.isScrolling){ self.canTap=false; return; } self.newPoints=getPointerXY(e); if(!(self.opts||self.canPan)||!self.newPoints.length||!self.newPoints.length){ return; } if(!(self.isSwiping&&self.isSwiping===true)){ e.preventDefault(); } self.distanceX=distance(self.newPoints[0], self.startPoints[0], "x"); self.distanceY=distance(self.newPoints[0], self.startPoints[0], "y"); self.distance=distance(self.newPoints[0], self.startPoints[0]); if(self.distance > 0){ if(self.isSwiping){ self.onSwipe(e); }else if(self.isPanning){ self.onPan(); }else if(self.isZooming){ self.onZoom(); }} }; Guestures.prototype.onSwipe=function(e){ var self=this, instance=self.instance, swiping=self.isSwiping, left=self.sliderStartPos.left||0, angle; if(swiping===true){ if(Math.abs(self.distance) > 10){ self.canTap=false; if(instance.group.length < 2&&self.opts.vertical){ self.isSwiping="y"; }else if(instance.isDragging||self.opts.vertical===false||(self.opts.vertical==="auto"&&$(window).width() > 800)){ self.isSwiping="x"; }else{ angle=Math.abs((Math.atan2(self.distanceY, self.distanceX) * 180) / Math.PI); self.isSwiping=angle > 45&&angle < 135 ? "y":"x"; } if(self.isSwiping==="y"&&$.fancybox.isMobile&&self.isScrollable){ self.isScrolling=true; return; } instance.isDragging=self.isSwiping; self.startPoints=self.newPoints; $.each(instance.slides, function(index, slide){ var slidePos, stagePos; $.fancybox.stop(slide.$slide); slidePos=$.fancybox.getTranslate(slide.$slide); stagePos=$.fancybox.getTranslate(instance.$refs.stage); slide.$slide .css({ transform: "", opacity: "", "transition-duration": "" }) .removeClass("fancybox-animated") .removeClass(function(index, className){ return (className.match(/(^|\s)fancybox-fx-\S+/g)||[]).join(" "); }); if(slide.pos===instance.current.pos){ self.sliderStartPos.top=slidePos.top - stagePos.top; self.sliderStartPos.left=slidePos.left - stagePos.left; } $.fancybox.setTranslate(slide.$slide, { top: slidePos.top - stagePos.top, left: slidePos.left - stagePos.left }); }); if(instance.SlideShow&&instance.SlideShow.isActive){ instance.SlideShow.stop(); }} return; } if(swiping=="x"){ if(self.distanceX > 0 && (self.instance.group.length < 2||(self.instance.current.index===0&&!self.instance.current.opts.loop)) ){ left=left + Math.pow(self.distanceX, 0.8); }else if(self.distanceX < 0 && (self.instance.group.length < 2 || (self.instance.current.index===self.instance.group.length - 1&&!self.instance.current.opts.loop)) ){ left=left - Math.pow(-self.distanceX, 0.8); }else{ left=left + self.distanceX; }} self.sliderLastPos={ top: swiping=="x" ? 0:self.sliderStartPos.top + self.distanceY, left: left }; if(self.requestId){ cancelAFrame(self.requestId); self.requestId=null; } self.requestId=requestAFrame(function(){ if(self.sliderLastPos){ $.each(self.instance.slides, function(index, slide){ var pos=slide.pos - self.instance.currPos; $.fancybox.setTranslate(slide.$slide, { top: self.sliderLastPos.top, left: self.sliderLastPos.left + pos * self.canvasWidth + pos * slide.opts.gutter }); }); self.$container.addClass("fancybox-is-sliding"); }}); }; Guestures.prototype.onPan=function(){ var self=this; if(distance(self.newPoints[0], self.realPoints[0]) < ($.fancybox.isMobile ? 10:5)){ self.startPoints=self.newPoints; return; } self.canTap=false; self.contentLastPos=self.limitMovement(); if(self.requestId){ cancelAFrame(self.requestId); } self.requestId=requestAFrame(function(){ $.fancybox.setTranslate(self.$content, self.contentLastPos); }); }; Guestures.prototype.limitMovement=function(){ var self=this; var canvasWidth=self.canvasWidth; var canvasHeight=self.canvasHeight; var distanceX=self.distanceX; var distanceY=self.distanceY; var contentStartPos=self.contentStartPos; var currentOffsetX=contentStartPos.left; var currentOffsetY=contentStartPos.top; var currentWidth=contentStartPos.width; var currentHeight=contentStartPos.height; var minTranslateX, minTranslateY, maxTranslateX, maxTranslateY, newOffsetX, newOffsetY; if(currentWidth > canvasWidth){ newOffsetX=currentOffsetX + distanceX; }else{ newOffsetX=currentOffsetX; } newOffsetY=currentOffsetY + distanceY; minTranslateX=Math.max(0, canvasWidth * 0.5 - currentWidth * 0.5); minTranslateY=Math.max(0, canvasHeight * 0.5 - currentHeight * 0.5); maxTranslateX=Math.min(canvasWidth - currentWidth, canvasWidth * 0.5 - currentWidth * 0.5); maxTranslateY=Math.min(canvasHeight - currentHeight, canvasHeight * 0.5 - currentHeight * 0.5); if(distanceX > 0&&newOffsetX > minTranslateX){ newOffsetX=minTranslateX - 1 + Math.pow(-minTranslateX + currentOffsetX + distanceX, 0.8)||0; } if(distanceX < 0&&newOffsetX < maxTranslateX){ newOffsetX=maxTranslateX + 1 - Math.pow(maxTranslateX - currentOffsetX - distanceX, 0.8)||0; } if(distanceY > 0&&newOffsetY > minTranslateY){ newOffsetY=minTranslateY - 1 + Math.pow(-minTranslateY + currentOffsetY + distanceY, 0.8)||0; } if(distanceY < 0&&newOffsetY < maxTranslateY){ newOffsetY=maxTranslateY + 1 - Math.pow(maxTranslateY - currentOffsetY - distanceY, 0.8)||0; } return { top: newOffsetY, left: newOffsetX };}; Guestures.prototype.limitPosition=function(newOffsetX, newOffsetY, newWidth, newHeight){ var self=this; var canvasWidth=self.canvasWidth; var canvasHeight=self.canvasHeight; if(newWidth > canvasWidth){ newOffsetX=newOffsetX > 0 ? 0:newOffsetX; newOffsetX=newOffsetX < canvasWidth - newWidth ? canvasWidth - newWidth:newOffsetX; }else{ newOffsetX=Math.max(0, canvasWidth / 2 - newWidth / 2); } if(newHeight > canvasHeight){ newOffsetY=newOffsetY > 0 ? 0:newOffsetY; newOffsetY=newOffsetY < canvasHeight - newHeight ? canvasHeight - newHeight:newOffsetY; }else{ newOffsetY=Math.max(0, canvasHeight / 2 - newHeight / 2); } return { top: newOffsetY, left: newOffsetX };}; Guestures.prototype.onZoom=function(){ var self=this; var contentStartPos=self.contentStartPos; var currentWidth=contentStartPos.width; var currentHeight=contentStartPos.height; var currentOffsetX=contentStartPos.left; var currentOffsetY=contentStartPos.top; var endDistanceBetweenFingers=distance(self.newPoints[0], self.newPoints[1]); var pinchRatio=endDistanceBetweenFingers / self.startDistanceBetweenFingers; var newWidth=Math.floor(currentWidth * pinchRatio); var newHeight=Math.floor(currentHeight * pinchRatio); var translateFromZoomingX=(currentWidth - newWidth) * self.percentageOfImageAtPinchPointX; var translateFromZoomingY=(currentHeight - newHeight) * self.percentageOfImageAtPinchPointY; var centerPointEndX=(self.newPoints[0].x + self.newPoints[1].x) / 2 - $(window).scrollLeft(); var centerPointEndY=(self.newPoints[0].y + self.newPoints[1].y) / 2 - $(window).scrollTop(); var translateFromTranslatingX=centerPointEndX - self.centerPointStartX; var translateFromTranslatingY=centerPointEndY - self.centerPointStartY; var newOffsetX=currentOffsetX + (translateFromZoomingX + translateFromTranslatingX); var newOffsetY=currentOffsetY + (translateFromZoomingY + translateFromTranslatingY); var newPos={ top: newOffsetY, left: newOffsetX, scaleX: pinchRatio, scaleY: pinchRatio }; self.canTap=false; self.newWidth=newWidth; self.newHeight=newHeight; self.contentLastPos=newPos; if(self.requestId){ cancelAFrame(self.requestId); } self.requestId=requestAFrame(function(){ $.fancybox.setTranslate(self.$content, self.contentLastPos); }); }; Guestures.prototype.ontouchend=function(e){ var self=this; var swiping=self.isSwiping; var panning=self.isPanning; var zooming=self.isZooming; var scrolling=self.isScrolling; self.endPoints=getPointerXY(e); self.dMs=Math.max(new Date().getTime() - self.startTime, 1); self.$container.removeClass("fancybox-is-grabbing"); $(document).off(".fb.touch"); document.removeEventListener("scroll", self.onscroll, true); if(self.requestId){ cancelAFrame(self.requestId); self.requestId=null; } self.isSwiping=false; self.isPanning=false; self.isZooming=false; self.isScrolling=false; self.instance.isDragging=false; if(self.canTap){ return self.onTap(e); } self.speed=100; self.velocityX=(self.distanceX / self.dMs) * 0.5; self.velocityY=(self.distanceY / self.dMs) * 0.5; if(panning){ self.endPanning(); }else if(zooming){ self.endZooming(); }else{ self.endSwiping(swiping, scrolling); } return; }; Guestures.prototype.endSwiping=function(swiping, scrolling){ var self=this, ret=false, len=self.instance.group.length, distanceX=Math.abs(self.distanceX), canAdvance=swiping=="x"&&len > 1&&((self.dMs > 130&&distanceX > 10)||distanceX > 50), speedX=300; self.sliderLastPos=null; if(swiping=="y"&&!scrolling&&Math.abs(self.distanceY) > 50){ $.fancybox.animate(self.instance.current.$slide, { top: self.sliderStartPos.top + self.distanceY + self.velocityY * 150, opacity: 0 }, 200 ); ret=self.instance.close(true, 250); }else if(canAdvance&&self.distanceX > 0){ ret=self.instance.previous(speedX); }else if(canAdvance&&self.distanceX < 0){ ret=self.instance.next(speedX); } if(ret===false&&(swiping=="x"||swiping=="y")){ self.instance.centerSlide(200); } self.$container.removeClass("fancybox-is-sliding"); }; Guestures.prototype.endPanning=function(){ var self=this, newOffsetX, newOffsetY, newPos; if(!self.contentLastPos){ return; } if(self.opts.momentum===false||self.dMs > 350){ newOffsetX=self.contentLastPos.left; newOffsetY=self.contentLastPos.top; }else{ newOffsetX=self.contentLastPos.left + self.velocityX * 500; newOffsetY=self.contentLastPos.top + self.velocityY * 500; } newPos=self.limitPosition(newOffsetX, newOffsetY, self.contentStartPos.width, self.contentStartPos.height); newPos.width=self.contentStartPos.width; newPos.height=self.contentStartPos.height; $.fancybox.animate(self.$content, newPos, 330); }; Guestures.prototype.endZooming=function(){ var self=this; var current=self.instance.current; var newOffsetX, newOffsetY, newPos, reset; var newWidth=self.newWidth; var newHeight=self.newHeight; if(!self.contentLastPos){ return; } newOffsetX=self.contentLastPos.left; newOffsetY=self.contentLastPos.top; reset={ top: newOffsetY, left: newOffsetX, width: newWidth, height: newHeight, scaleX: 1, scaleY: 1 }; $.fancybox.setTranslate(self.$content, reset); if(newWidth < self.canvasWidth&&newHeight < self.canvasHeight){ self.instance.scaleToFit(150); }else if(newWidth > current.width||newHeight > current.height){ self.instance.scaleToActual(self.centerPointStartX, self.centerPointStartY, 150); }else{ newPos=self.limitPosition(newOffsetX, newOffsetY, newWidth, newHeight); $.fancybox.animate(self.$content, newPos, 150); }}; Guestures.prototype.onTap=function(e){ var self=this; var $target=$(e.target); var instance=self.instance; var current=instance.current; var endPoints=(e&&getPointerXY(e))||self.startPoints; var tapX=endPoints[0] ? endPoints[0].x - $(window).scrollLeft() - self.stagePos.left:0; var tapY=endPoints[0] ? endPoints[0].y - $(window).scrollTop() - self.stagePos.top:0; var where; var process=function(prefix){ var action=current.opts[prefix]; if($.isFunction(action)){ action=action.apply(instance, [current, e]); } if(!action){ return; } switch (action){ case "close": instance.close(self.startEvent); break; case "toggleControls": instance.toggleControls(); break; case "next": instance.next(); break; case "nextOrClose": if(instance.group.length > 1){ instance.next(); }else{ instance.close(self.startEvent); } break; case "zoom": if(current.type=="image"&&(current.isLoaded||current.$ghost)){ if(instance.canPan()){ instance.scaleToFit(); }else if(instance.isScaledDown()){ instance.scaleToActual(tapX, tapY); }else if(instance.group.length < 2){ instance.close(self.startEvent); }} break; }}; if(e.originalEvent&&e.originalEvent.button==2){ return; } if(!$target.is("img")&&tapX > $target[0].clientWidth + $target.offset().left){ return; } if($target.is(".fancybox-bg,.fancybox-inner,.fancybox-outer,.fancybox-container")){ where="Outside"; }else if($target.is(".fancybox-slide")){ where="Slide"; }else if(instance.current.$content && instance.current.$content .find($target) .addBack() .filter($target).length ){ where="Content"; }else{ return; } if(self.tapped){ clearTimeout(self.tapped); self.tapped=null; if(Math.abs(tapX - self.tapX) > 50||Math.abs(tapY - self.tapY) > 50){ return this; } process("dblclick" + where); }else{ self.tapX=tapX; self.tapY=tapY; if(current.opts["dblclick" + where]&¤t.opts["dblclick" + where]!==current.opts["click" + where]){ self.tapped=setTimeout(function(){ self.tapped=null; if(!instance.isAnimating){ process("click" + where); }}, 500); }else{ process("click" + where); }} return this; }; $(document) .on("onActivate.fb", function(e, instance){ if(instance&&!instance.Guestures){ instance.Guestures=new Guestures(instance); }}) .on("beforeClose.fb", function(e, instance){ if(instance&&instance.Guestures){ instance.Guestures.destroy(); }}); })(window, document, jQuery); (function(document, $){ "use strict"; $.extend(true, $.fancybox.defaults, { btnTpl: { slideShow: '" }, slideShow: { autoStart: false, speed: 3000, progress: true }}); var SlideShow=function(instance){ this.instance=instance; this.init(); }; $.extend(SlideShow.prototype, { timer: null, isActive: false, $button: null, init: function(){ var self=this, instance=self.instance, opts=instance.group[instance.currIndex].opts.slideShow; self.$button=instance.$refs.toolbar.find("[data-fancybox-play]").on("click", function(){ self.toggle(); }); if(instance.group.length < 2||!opts){ self.$button.hide(); }else if(opts.progress){ self.$progress=$('
').appendTo(instance.$refs.inner); }}, set: function(force){ var self=this, instance=self.instance, current=instance.current; if(current&&(force===true||current.opts.loop||instance.currIndex < instance.group.length - 1)){ if(self.isActive&¤t.contentType!=="video"){ if(self.$progress){ $.fancybox.animate(self.$progress.show(), {scaleX: 1}, current.opts.slideShow.speed); } self.timer=setTimeout(function(){ if(!instance.current.opts.loop&&instance.current.index==instance.group.length - 1){ instance.jumpTo(0); }else{ instance.next(); }}, current.opts.slideShow.speed); }}else{ self.stop(); instance.idleSecondsCounter=0; instance.showControls(); }}, clear: function(){ var self=this; clearTimeout(self.timer); self.timer=null; if(self.$progress){ self.$progress.removeAttr("style").hide(); }}, start: function(){ var self=this, current=self.instance.current; if(current){ self.$button .attr("title", (current.opts.i18n[current.opts.lang]||current.opts.i18n.en).PLAY_STOP) .removeClass("fancybox-button--play") .addClass("fancybox-button--pause"); self.isActive=true; if(current.isComplete){ self.set(true); } self.instance.trigger("onSlideShowChange", true); }}, stop: function(){ var self=this, current=self.instance.current; self.clear(); self.$button .attr("title", (current.opts.i18n[current.opts.lang]||current.opts.i18n.en).PLAY_START) .removeClass("fancybox-button--pause") .addClass("fancybox-button--play"); self.isActive=false; self.instance.trigger("onSlideShowChange", false); if(self.$progress){ self.$progress.removeAttr("style").hide(); }}, toggle: function(){ var self=this; if(self.isActive){ self.stop(); }else{ self.start(); }} }); $(document).on({ "onInit.fb": function(e, instance){ if(instance&&!instance.SlideShow){ instance.SlideShow=new SlideShow(instance); }}, "beforeShow.fb": function(e, instance, current, firstRun){ var SlideShow=instance&&instance.SlideShow; if(firstRun){ if(SlideShow&¤t.opts.slideShow.autoStart){ SlideShow.start(); }}else if(SlideShow&&SlideShow.isActive){ SlideShow.clear(); }}, "afterShow.fb": function(e, instance, current){ var SlideShow=instance&&instance.SlideShow; if(SlideShow&&SlideShow.isActive){ SlideShow.set(); }}, "afterKeydown.fb": function(e, instance, current, keypress, keycode){ var SlideShow=instance&&instance.SlideShow; if(SlideShow&¤t.opts.slideShow&&(keycode===80||keycode===32)&&!$(document.activeElement).is("button,a,input")){ keypress.preventDefault(); SlideShow.toggle(); }}, "beforeClose.fb onDeactivate.fb": function(e, instance){ var SlideShow=instance&&instance.SlideShow; if(SlideShow){ SlideShow.stop(); }} }); $(document).on("visibilitychange", function(){ var instance=$.fancybox.getInstance(), SlideShow=instance&&instance.SlideShow; if(SlideShow&&SlideShow.isActive){ if(document.hidden){ SlideShow.clear(); }else{ SlideShow.set(); }} }); })(document, jQuery); (function(document, $){ "use strict"; var fn=(function(){ var fnMap=[ ["requestFullscreen", "exitFullscreen", "fullscreenElement", "fullscreenEnabled", "fullscreenchange", "fullscreenerror"], [ "webkitRequestFullscreen", "webkitExitFullscreen", "webkitFullscreenElement", "webkitFullscreenEnabled", "webkitfullscreenchange", "webkitfullscreenerror" ], [ "webkitRequestFullScreen", "webkitCancelFullScreen", "webkitCurrentFullScreenElement", "webkitCancelFullScreen", "webkitfullscreenchange", "webkitfullscreenerror" ], [ "mozRequestFullScreen", "mozCancelFullScreen", "mozFullScreenElement", "mozFullScreenEnabled", "mozfullscreenchange", "mozfullscreenerror" ], ["msRequestFullscreen", "msExitFullscreen", "msFullscreenElement", "msFullscreenEnabled", "MSFullscreenChange", "MSFullscreenError"] ]; var ret={}; for (var i=0; i < fnMap.length; i++){ var val=fnMap[i]; if(val&&val[1] in document){ for (var j=0; j < val.length; j++){ ret[fnMap[0][j]]=val[j]; } return ret; }} return false; })(); if(fn){ var FullScreen={ request: function(elem){ elem=elem||document.documentElement; elem[fn.requestFullscreen](elem.ALLOW_KEYBOARD_INPUT); }, exit: function(){ document[fn.exitFullscreen](); }, toggle: function(elem){ elem=elem||document.documentElement; if(this.isFullscreen()){ this.exit(); }else{ this.request(elem); }}, isFullscreen: function(){ return Boolean(document[fn.fullscreenElement]); }, enabled: function(){ return Boolean(document[fn.fullscreenEnabled]); }}; $.extend(true, $.fancybox.defaults, { btnTpl: { fullScreen: '" }, fullScreen: { autoStart: false }}); $(document).on(fn.fullscreenchange, function(){ var isFullscreen=FullScreen.isFullscreen(), instance=$.fancybox.getInstance(); if(instance){ if(instance.current&&instance.current.type==="image"&&instance.isAnimating){ instance.current.$content.css("transition", "none"); instance.isAnimating=false; instance.update(true, true, 0); } instance.trigger("onFullscreenChange", isFullscreen); instance.$refs.container.toggleClass("fancybox-is-fullscreen", isFullscreen); instance.$refs.toolbar .find("[data-fancybox-fullscreen]") .toggleClass("fancybox-button--fsenter", !isFullscreen) .toggleClass("fancybox-button--fsexit", isFullscreen); }}); } $(document).on({ "onInit.fb": function(e, instance){ var $container; if(!fn){ instance.$refs.toolbar.find("[data-fancybox-fullscreen]").remove(); return; } if(instance&&instance.group[instance.currIndex].opts.fullScreen){ $container=instance.$refs.container; $container.on("click.fb-fullscreen", "[data-fancybox-fullscreen]", function(e){ e.stopPropagation(); e.preventDefault(); FullScreen.toggle(); }); if(instance.opts.fullScreen&&instance.opts.fullScreen.autoStart===true){ FullScreen.request(); } instance.FullScreen=FullScreen; }else if(instance){ instance.$refs.toolbar.find("[data-fancybox-fullscreen]").hide(); }}, "afterKeydown.fb": function(e, instance, current, keypress, keycode){ if(instance&&instance.FullScreen&&keycode===70){ keypress.preventDefault(); instance.FullScreen.toggle(); }}, "beforeClose.fb": function(e, instance){ if(instance&&instance.FullScreen&&instance.$refs.container.hasClass("fancybox-is-fullscreen")){ FullScreen.exit(); }} }); })(document, jQuery); (function(document, $){ "use strict"; var CLASS="fancybox-thumbs", CLASS_ACTIVE=CLASS + "-active"; $.fancybox.defaults=$.extend(true, { btnTpl: { thumbs: '" }, thumbs: { autoStart: false, hideOnClose: true, parentEl: ".fancybox-container", axis: "y" }}, $.fancybox.defaults ); var FancyThumbs=function(instance){ this.init(instance); }; $.extend(FancyThumbs.prototype, { $button: null, $grid: null, $list: null, isVisible: false, isActive: false, init: function(instance){ var self=this, group=instance.group, enabled=0; self.instance=instance; self.opts=group[instance.currIndex].opts.thumbs; instance.Thumbs=self; self.$button=instance.$refs.toolbar.find("[data-fancybox-thumbs]"); for (var i=0, len=group.length; i < len; i++){ if(group[i].thumb){ enabled++; } if(enabled > 1){ break; }} if(enabled > 1&&!!self.opts){ self.$button.removeAttr("style").on("click", function(){ self.toggle(); }); self.isActive=true; }else{ self.$button.hide(); }}, create: function(){ var self=this, instance=self.instance, parentEl=self.opts.parentEl, list=[], src; if(!self.$grid){ self.$grid=$('
').appendTo(instance.$refs.container .find(parentEl) .addBack() .filter(parentEl) ); self.$grid.on("click", "a", function(){ instance.jumpTo($(this).attr("data-index")); }); } if(!self.$list){ self.$list=$('
').appendTo(self.$grid); } $.each(instance.group, function(i, item){ src=item.thumb; if(!src&&item.type==="image"){ src=item.src; } list.push('" ); }); self.$list[0].innerHTML=list.join(""); if(self.opts.axis==="x"){ self.$list.width(parseInt(self.$grid.css("padding-right"), 10) + instance.group.length * self.$list .children() .eq(0) .outerWidth(true) ); }}, focus: function(duration){ var self=this, $list=self.$list, $grid=self.$grid, thumb, thumbPos; if(!self.instance.current){ return; } thumb=$list .children() .removeClass(CLASS_ACTIVE) .filter('[data-index="' + self.instance.current.index + '"]') .addClass(CLASS_ACTIVE); thumbPos=thumb.position(); if(self.opts.axis==="y"&&(thumbPos.top < 0||thumbPos.top > $list.height() - thumb.outerHeight())){ $list.stop().animate({ scrollTop: $list.scrollTop() + thumbPos.top }, duration ); }else if(self.opts.axis==="x" && (thumbPos.left < $grid.scrollLeft()||thumbPos.left > $grid.scrollLeft() + ($grid.width() - thumb.outerWidth())) ){ $list .parent() .stop() .animate({ scrollLeft: thumbPos.left }, duration ); }}, update: function(){ var that=this; that.instance.$refs.container.toggleClass("fancybox-show-thumbs", this.isVisible); if(that.isVisible){ if(!that.$grid){ that.create(); } that.instance.trigger("onThumbsShow"); that.focus(0); }else if(that.$grid){ that.instance.trigger("onThumbsHide"); } that.instance.update(); }, hide: function(){ this.isVisible=false; this.update(); }, show: function(){ this.isVisible=true; this.update(); }, toggle: function(){ this.isVisible = !this.isVisible; this.update(); }}); $(document).on({ "onInit.fb": function(e, instance){ var Thumbs; if(instance&&!instance.Thumbs){ Thumbs=new FancyThumbs(instance); if(Thumbs.isActive&&Thumbs.opts.autoStart===true){ Thumbs.show(); }} }, "beforeShow.fb": function(e, instance, item, firstRun){ var Thumbs=instance&&instance.Thumbs; if(Thumbs&&Thumbs.isVisible){ Thumbs.focus(firstRun ? 0:250); }}, "afterKeydown.fb": function(e, instance, current, keypress, keycode){ var Thumbs=instance&&instance.Thumbs; if(Thumbs&&Thumbs.isActive&&keycode===71){ keypress.preventDefault(); Thumbs.toggle(); }}, "beforeClose.fb": function(e, instance){ var Thumbs=instance&&instance.Thumbs; if(Thumbs&&Thumbs.isVisible&&Thumbs.opts.hideOnClose!==false){ Thumbs.$grid.hide(); }} }); })(document, jQuery); (function(document, $){ "use strict"; $.extend(true, $.fancybox.defaults, { btnTpl: { share: '" }, share: { url: function(instance, item){ return ( (!instance.currentHash&&!(item.type==="inline"||item.type==="html") ? item.origSrc||item.src:false)||window.location ); }, tpl: '
' + "

{{SHARE}}

" + "

" + '' + '' + "Facebook" + "" + '' + '' + "Twitter" + "" + '' + '' + "Pinterest" + "" + "

" + '

' + "
" }}); function escapeHtml(string){ var entityMap={ "&": "&", "<": "<", ">": ">", '"': """, "'": "'", "/": "/", "`": "`", "=": "=" }; return String(string).replace(/[&<>"'`=\/]/g, function(s){ return entityMap[s]; }); } $(document).on("click", "[data-fancybox-share]", function(){ var instance=$.fancybox.getInstance(), current=instance.current||null, url, tpl; if(!current){ return; } if($.type(current.opts.share.url)==="function"){ url=current.opts.share.url.apply(current, [instance, current]); } tpl=current.opts.share.tpl .replace(/\{\{media\}\}/g, current.type==="image" ? encodeURIComponent(current.src):"") .replace(/\{\{url\}\}/g, encodeURIComponent(url)) .replace(/\{\{url_raw\}\}/g, escapeHtml(url)) .replace(/\{\{descr\}\}/g, instance.$caption ? encodeURIComponent(instance.$caption.text()):""); $.fancybox.open({ src: instance.translate(instance, tpl), type: "html", opts: { touch: false, animationEffect: false, afterLoad: function(shareInstance, shareCurrent){ instance.$refs.container.one("beforeClose.fb", function(){ shareInstance.close(null, 0); }); shareCurrent.$content.find(".fancybox-share__button").click(function(){ window.open(this.href, "Share", "width=550, height=450"); return false; }); }, mobile: { autoFocus: false }} }); }); })(document, jQuery); (function(window, document, $){ "use strict"; if(!$.escapeSelector){ $.escapeSelector=function(sel){ var rcssescape=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g; var fcssescape=function(ch, asCodePoint){ if(asCodePoint){ if(ch==="\0"){ return "\uFFFD"; } return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16) + " "; } return "\\" + ch; }; return (sel + "").replace(rcssescape, fcssescape); };} function parseUrl(){ var hash=window.location.hash.substr(1), rez=hash.split("-"), index=rez.length > 1&&/^\+?\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10)||1:1, gallery=rez.join("-"); return { hash: hash, index: index < 1 ? 1:index, gallery: gallery };} function triggerFromUrl(url){ if(url.gallery!==""){ $("[data-fancybox='" + $.escapeSelector(url.gallery) + "']") .eq(url.index - 1) .focus() .trigger("click.fb-start"); }} function getGalleryID(instance){ var opts, ret; if(!instance){ return false; } opts=instance.current ? instance.current.opts:instance.opts; ret=opts.hash||(opts.$orig ? opts.$orig.data("fancybox")||opts.$orig.data("fancybox-trigger"):""); return ret==="" ? false:ret; } $(function(){ if($.fancybox.defaults.hash===false){ return; } $(document).on({ "onInit.fb": function(e, instance){ var url, gallery; if(instance.group[instance.currIndex].opts.hash===false){ return; } url=parseUrl(); gallery=getGalleryID(instance); if(gallery&&url.gallery&&gallery==url.gallery){ instance.currIndex=url.index - 1; }}, "beforeShow.fb": function(e, instance, current, firstRun){ var gallery; if(!current||current.opts.hash===false){ return; } gallery=getGalleryID(instance); if(!gallery){ return; } instance.currentHash=gallery + (instance.group.length > 1 ? "-" + (current.index + 1):""); if(window.location.hash==="#" + instance.currentHash){ return; } if(firstRun&&!instance.origHash){ instance.origHash=window.location.hash; } if(instance.hashTimer){ clearTimeout(instance.hashTimer); } instance.hashTimer=setTimeout(function(){ if("replaceState" in window.history){ window.history[firstRun ? "pushState":"replaceState"]( {}, document.title, window.location.pathname + window.location.search + "#" + instance.currentHash ); if(firstRun){ instance.hasCreatedHistory=true; }}else{ window.location.hash=instance.currentHash; } instance.hashTimer=null; }, 300); }, "beforeClose.fb": function(e, instance, current){ if(current.opts.hash===false){ return; } clearTimeout(instance.hashTimer); if(instance.currentHash&&instance.hasCreatedHistory){ window.history.back(); }else if(instance.currentHash){ if("replaceState" in window.history){ window.history.replaceState({}, document.title, window.location.pathname + window.location.search + (instance.origHash||"")); }else{ window.location.hash=instance.origHash; }} instance.currentHash=null; }}); $(window).on("hashchange.fb", function(){ var url=parseUrl(), fb=null; $.each($(".fancybox-container") .get() .reverse(), function(index, value){ var tmp=$(value).data("FancyBox"); if(tmp&&tmp.currentHash){ fb=tmp; return false; }} ); if(fb){ if(fb.currentHash!==url.gallery + "-" + url.index&&!(url.index===1&&fb.currentHash==url.gallery)){ fb.currentHash=null; fb.close(); }}else if(url.gallery!==""){ triggerFromUrl(url); }}); setTimeout(function(){ if(!$.fancybox.getInstance()){ triggerFromUrl(parseUrl()); }}, 50); }); })(window, document, jQuery); (function(document, $){ "use strict"; var prevTime=new Date().getTime(); $(document).on({ "onInit.fb": function(e, instance, current){ instance.$refs.stage.on("mousewheel DOMMouseScroll wheel MozMousePixelScroll", function(e){ var current=instance.current, currTime=new Date().getTime(); if(instance.group.length < 2||current.opts.wheel===false||(current.opts.wheel==="auto"&¤t.type!=="image")){ return; } e.preventDefault(); e.stopPropagation(); if(current.$slide.hasClass("fancybox-animated")){ return; } e=e.originalEvent||e; if(currTime - prevTime < 250){ return; } prevTime=currTime; instance[(-e.deltaY||-e.deltaX||e.wheelDelta||-e.detail) < 0 ? "next":"previous"](); }); }}); })(document, jQuery); ;(function(factory){ 'use strict'; if(typeof define==='function'&&define.amd){ define(['jquery'], factory); }else if(typeof exports!=='undefined'){ module.exports=factory(require('jquery')); }else{ factory(jQuery); }}(function($){ 'use strict'; var Slick=window.Slick||{}; Slick=(function(){ var instanceUid=0; function Slick(element, settings){ var _=this, dataSettings; _.defaults={ accessibility: true, adaptiveHeight: false, appendArrows: $(element), appendDots: $(element), arrows: true, asNavFor: null, prevArrow: '', nextArrow: '', autoplay: false, autoplaySpeed: 3000, centerMode: false, centerPadding: '50px', cssEase: 'ease', customPaging: function(slider, i){ return $('
a",l.leadingWhitespace=3===a.firstChild.nodeType,l.tbody=!a.getElementsByTagName("tbody").length,l.htmlSerialize=!!a.getElementsByTagName("link").length,l.html5Clone="<:nav>"!==d.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,b.appendChild(c),l.appendChecked=c.checked,a.innerHTML="",l.noCloneChecked=!!a.cloneNode(!0).lastChild.defaultValue,b.appendChild(a),c=d.createElement("input"),c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),a.appendChild(c),l.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!!a.addEventListener,a[n.expando]=1,l.attributes=!a.getAttribute(n.expando)}();var da={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:l.htmlSerialize?[0,"",""]:[1,"X
","
"]};da.optgroup=da.option,da.tbody=da.tfoot=da.colgroup=da.caption=da.thead,da.th=da.td;function ea(a,b){var c,d,e=0,f="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,ea(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function fa(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}var ga=/<|&#?\w+;/,ha=/r;r++)if(g=a[r],g||0===g)if("object"===n.type(g))n.merge(q,g.nodeType?[g]:g);else if(ga.test(g)){i=i||p.appendChild(b.createElement("div")),j=($.exec(g)||["",""])[1].toLowerCase(),m=da[j]||da._default,i.innerHTML=m[1]+n.htmlPrefilter(g)+m[2],f=m[0];while(f--)i=i.lastChild;if(!l.leadingWhitespace&&aa.test(g)&&q.push(b.createTextNode(aa.exec(g)[0])),!l.tbody){g="table"!==j||ha.test(g)?""!==m[1]||ha.test(g)?0:i:i.firstChild,f=g&&g.childNodes.length;while(f--)n.nodeName(k=g.childNodes[f],"tbody")&&!k.childNodes.length&&g.removeChild(k)}n.merge(q,i.childNodes),i.textContent="";while(i.firstChild)i.removeChild(i.firstChild);i=p.lastChild}else q.push(b.createTextNode(g));i&&p.removeChild(i),l.appendChecked||n.grep(ea(q,"input"),ia),r=0;while(g=q[r++])if(d&&n.inArray(g,d)>-1)e&&e.push(g);else if(h=n.contains(g.ownerDocument,g),i=ea(p.appendChild(g),"script"),h&&fa(i),c){f=0;while(g=i[f++])_.test(g.type||"")&&c.push(g)}return i=null,p}!function(){var b,c,e=d.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b]=c in a)||(e.setAttribute(c,"t"),l[b]=e.attributes[c].expando===!1);e=null}();var ka=/^(?:input|select|textarea)$/i,la=/^key/,ma=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,na=/^(?:focusinfocus|focusoutblur)$/,oa=/^([^.]*)(?:\.(.+)|)/;function pa(){return!0}function qa(){return!1}function ra(){try{return d.activeElement}catch(a){}}function sa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)sa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=qa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return"undefined"==typeof n||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(G)||[""],h=b.length;while(h--)f=oa.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=oa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(i=m=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!na.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),h=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),l=n.event.special[q]||{},f||!l.trigger||l.trigger.apply(e,c)!==!1)){if(!f&&!l.noBubble&&!n.isWindow(e)){for(j=l.delegateType||q,na.test(j+q)||(i=i.parentNode);i;i=i.parentNode)p.push(i),m=i;m===(e.ownerDocument||d)&&p.push(m.defaultView||m.parentWindow||a)}o=0;while((i=p[o++])&&!b.isPropagationStopped())b.type=o>1?j:l.bindType||q,g=(n._data(i,"events")||{})[b.type]&&n._data(i,"handle"),g&&g.apply(i,c),g=h&&i[h],g&&g.apply&&M(i)&&(b.result=g.apply(i,c),b.result===!1&&b.preventDefault());if(b.type=q,!f&&!b.isDefaultPrevented()&&(!l._default||l._default.apply(p.pop(),c)===!1)&&M(e)&&h&&e[q]&&!n.isWindow(e)){m=e[h],m&&(e[h]=null),n.event.triggered=q;try{e[q]()}catch(s){}n.event.triggered=void 0,m&&(e[h]=m)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())a.rnamespace&&!a.rnamespace.test(g.namespace)||(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]","i"),va=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,wa=/\s*$/g,Aa=ca(d),Ba=Aa.appendChild(d.createElement("div"));function Ca(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function Da(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function Ea(a){var b=ya.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Ga(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(Da(b).text=a.text,Ea(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&Z.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}}function Ha(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&xa.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(o&&(k=ja(b,a[0].ownerDocument,!1,a,d),e=k.firstChild,1===k.childNodes.length&&(k=e),e||d)){for(i=n.map(ea(k,"script"),Da),h=i.length;o>m;m++)g=k,m!==p&&(g=n.clone(g,!0,!0),h&&n.merge(i,ea(g,"script"))),c.call(a[m],g,m);if(h)for(j=i[i.length-1].ownerDocument,n.map(i,Ea),m=0;h>m;m++)g=i[m],_.test(g.type||"")&&!n._data(g,"globalEval")&&n.contains(j,g)&&(g.src?n._evalUrl&&n._evalUrl(g.src):n.globalEval((g.text||g.textContent||g.innerHTML||"").replace(za,"")));k=e=null}return a}function Ia(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(ea(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&fa(ea(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(va,"<$1>")},clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!ua.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(Ba.innerHTML=a.outerHTML,Ba.removeChild(f=Ba.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=ea(f),h=ea(a),g=0;null!=(e=h[g]);++g)d[g]&&Ga(e,d[g]);if(b)if(c)for(h=h||ea(a),d=d||ea(f),g=0;null!=(e=h[g]);g++)Fa(e,d[g]);else Fa(a,f);return d=ea(f,"script"),d.length>0&&fa(d,!i&&ea(a,"script")),d=h=e=null,f},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.attributes,m=n.event.special;null!=(d=a[h]);h++)if((b||M(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k||"undefined"==typeof d.removeAttribute?d[i]=void 0:d.removeAttribute(i),c.push(f))}}}),n.fn.extend({domManip:Ha,detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return Y(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||d).createTextNode(a))},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(ea(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return Y(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(ta,""):void 0;if("string"==typeof a&&!wa.test(a)&&(l.htmlSerialize||!ua.test(a))&&(l.leadingWhitespace||!aa.test(a))&&!da[($.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ea(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ha(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(ea(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],f=n(a),h=f.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(f[d])[b](c),g.apply(e,c.get());return this.pushStack(e)}});var Ja,Ka={HTML:"block",BODY:"block"};function La(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function Ma(a){var b=d,c=Ka[a];return c||(c=La(a,b),"none"!==c&&c||(Ja=(Ja||n("